HaywireInteractive / OnAllFronts-Public

UE5 MilSim FPS / RTS Game (formerly ProjectM)
MIT License
128 stars 24 forks source link

UAV projectiles don't hit where camera is facing #770

Closed Leroy231 closed 11 months ago

Leroy231 commented 1 year ago

In screenshot below the camera was centered on tank, but projectile hit where red dot is. The BP with homing missile logic is Missile_Root. It has a ProjectileMovement component with "Is Homing Projectile" set to true and in MQ9Reaper_BP under LineTraceTick event in Weaponry event subgraph it does a line trace and updates the location of "Laser Target Root" component. Then this component is set as the projectile movement component's Homing Target Component in MQ9Reaper_BP under Macro "FireMacro". Also relevant, in Missile_Root there's a "HomingLerp" event which lerps the projectile movement component's Homing Acceleration Magnitude but even removing the lerp and setting a high acceleration initially still causes the project to miss its target for some reason. It may help to watch this tutorial on homing if you're not familiar with it.

Image