Hello,
I’m using the scripts of FPS tutorial, and my problem is that I’ve inserted the crosshair, the the bullets don’t hit the center, instead they hit a little bit to the left.
How can I correct this?
Thank you.
Hello,
I’m using the scripts of FPS tutorial, and my problem is that I’ve inserted the crosshair, the the bullets don’t hit the center, instead they hit a little bit to the left.
How can I correct this?
Thank you.
The only way to always hit the crosshair point is to shoot from the camera instead of shooting from the weapon. This can be done perfectly with the machine gun (but not with the rocket launcher!) - just change the raycast origin in the first lines of the function FireOneShot (in MachineGun.js script):
... function FireOneShot () { var camTransf = Camera.main.transform; // get the camera transform var hit : RaycastHit; // use the camera transform in the raycast: if (Physics.Raycast(camTransf.position, camTransf.forward, hit, range)) { ...