Ideally I simply set rotation and my projectile would move based on which direction it’s facing. But because I’m activating projectile movement after actor is already spawned, it ignores rotation changes and only responds to velocity changes. Because velocity is determined when it spawns rather than when movement is activated.
So it seems I have to set velocity directly. And I’m having difficulty translating Camera Rotation (where I’m looking) to projectile Velocity…
To clarify, actor spawns… and is eventually released and fires (activate projectile movement) in the direction we’re looking. But velocity is calculated based on the rotation when actor is spawned. It doesn’t update when activated.
To update the trajectory of the projectile based on the facing of the camera?
I’ve never needed to do this specifically, but my approach would be along these lines (if relying on blueprints alone)
Timer by event.
1 - Get the current velocity and the Camera’s Forward vector
2 - Zero out the current velocity (a toggle of simulate physics between if all is being done between frames)
3 - (assuming 2 disabled simulate) toggle it back on.
4 - Apply an impulse to the projectile following the camera’s forward using a force adequate to apply the velocity it had.