i am trying to set the line trace to set to the center of the screen on every object that is first in the view (or should i make the crosshair follow the line trace?) but no success. If i am shooting an object that is very close, the line trace is way off to the left from the middle, if i am shooting something far away i am less off to the left.
you’re hit result is likely correct but you havent updated the trace, so the trace will always END at your Camera forward vector, if you want to update your debug line then OnTraceHit you need a second trace from your muzzle to your HitLocation or if you want to move the Cursor to the HitPoint you’d need to convert WorldLocation To ScreenLocation and update your widget
how to update the trace please?
if you want to shoot exactly at the crosshair you need 2 separate traces one from Camera to Camera End which you have, and a second trace from the barrel to the CameraHitResult or CameraEnd if no hit.
this will make the gun shoot exactly where the crosshair is, keep in mind you could still get weird results with close objects
Can we see the updated part that spawns the bullet actor?
thank you i will try your solution ![]()
thats how it looks atm in game with projectiles shooting from the camera and without bullet from barrel projectile
you re setting the impact point after spawning the projectile, you need to do it first
thank you











