I am making an fps game but my shots always end up slightly below and to the right of where they are supposed to hit (whatever is in the center of the screen.) I’ve used the ScreenPointToRay function to aim the gun at whatever point is currently displayed in the center of the screen. Problem is, when I actually fire the gun the projectile ends up the slightest bit off of where it should be. See here:
That is where the shot hits the wall (I’ve tested enough to know it’s not just me moving the reticle after firing.)
I’ve tried everything I can think of – I used a debug raycast to make sure the shot spawner on the end of the gun is rotated to face the target point; I’ve double checked that the raycast points toward the center – the point at which the gun should be aiming is definitely correct. Could it be possible the bullet object itself is offset from its origin somehow? It doesn’t look like it in the inspector but I really don’t know. Please help, I’m running low on ideas!