r/UnityHelp • • Mar 14 '23

Can you help me fps shoot bullet direction problem

Hi guys! I am making a simple fps game from this youtube video https://youtu.be/OFXvvuxqPNQ

There is a error that my bullet doesn't go forward,it goes to the left direction can you help me please

3 Upvotes

2 comments sorted by

1

u/FamiliarDog6598 Mar 14 '23

void Shoot

Debug.Log("shoot!");

GameObject bullet = Instantiate(bulletprefab, bulletpoint.transform.position, transform.rotation); bullet.GetComponent<Rigidbody>().AddForce(transform.forward- bulletSpeed); Destroy(bullet, 1);

I used same script from video

1

u/couchpotatochip21 Mar 14 '23

Sounds like the gun you are using is pointed to the left, even if the mesh is aiming forward. If the game object you are using is a prefab, go into the prefab and rotate the mesh (or 3d model) to the left. You will have to rotate the prefab in the viewport as well.