Crosshair Accuracy

Hey everyone, I have this issue that’s driving me insane and I don’t know how to fix it thanks to my excellent math skills lol.
My bullets are shot towards a world location along the turret muzzle’s forward axis, that same world location is used to position the crosshair on the screen. I’ll try to illustrate the problem since my English is failing me.
image


On your screen, you’d see that your crosshair is perfectly over the target but your bullet’s trajectory is far from it.
My bullets are actual meshes that’s why I can’t skip this part and use line tracing instead.
Thanks!

So there are two ways to fix this. One, if the player is holding a gun is to actually fire the bullet from the crosshair point on the screen. The flash from the turret or gun will give the illusion that the bullet comes from there.

The second is to do a line trace from the gun to the hit point and move the cross hair to the location of the hit point on the screen. This is then a predicted hit point.

A third solution is to not fix it! The player has to have some skill in the shot to guess how far left or right the actual hit point will be. That could be a good challenge as part of the game style.

So there are two ways to fix this. One, if the player is holding a gun is to actually fire the bullet from the crosshair point on the screen. The flash from the turret or gun will give the illusion that the bullet comes from there.

I can’t do this since I use a static mesh for bullets and game logic, it’d be awkward for bullets to come out from the camera center and have the muzzle flash on the gun lol.

The second is to do a line trace from the gun to the hit point and move the cross hair to the location of the hit point on the screen. This is then a predicted hit point.

I also tried this one before posting. It works but the problem in this case is that the crosshair will either disappear or remain static if the line trace hits nothing which is obviously bad.

But you know what? I didn’t think of this so maybe I’ll just leave it as it is until someone suggests a solution, thank you :slight_smile: