How do I get the forward of momentum?

I want to keep the forward of a projectile pointing in the direction of movement, eg. a missile bouncing off of something should still point nose-forward to the bounce motion.

How do I get the angle of momentum to update the mesh(es) to point in line with that as their new forward?

[GetVelocity]->[RotatorFromXVector]->[SetActorRotation]

All on EventTick

If you’re working with the projectile movement component:


If not, then setting the rotation from forward vector would, ofc, work more than fine. May be even preferable, depending on how often we need to adjust it. If it’s a singular event, only after the impact, setting the rotation manually once may work just fine. If you have other forces acting on the projectile, you’ll need to do it more often.

Or use the component magic above:

Image from Gyazo

And same behaviour with no component magic:

First thing I tried. It gives a rotator that is constant across iterations but has nothing to do with the actual momentum of the projectile.

Eg. if I have 5 moving projectiles in the scene moving in different directions, the result for all of them points in the same direction but is only pointing in the direction of the motion of any of them by chance.

I’m using a simpler custom projectile.
Just a basic launch on spawn with collision and destroy… but for this test I’m only using the launch.

After that, I set a timer to update the facing of the mesh using the method that Should Work, which both of you have also suggested I use.

But the result is this.
[Video of the result][3]
Regardless of the direction of motion, the Velocity → Rotation from XVector = the same.

The hierarchy is not set up right atm. If you’re simulating physics, ensure the simulating element is at the root - drag it there. This is critical for many reasons.

Currently the velocity you’re sampling is 0 at all times. You’re adding force to the component but the actual actor sits absolutely still. Print the velocity.


For example, this box is simulating physics, it fell. But the actor is still in the air because the root was not simulating physics:

Were you to ask this actor for its location, forward vector, velocity and so on, it’d report that mid-air state.


Alternatively:

Get the V from the simulating components itself.


Technically nothing stops you from not having it at the root for as long as you’re aware of this behaviour. Imagine an actor with 10 simulating static meshes. What is the actor’s location? Is it the average location of all the meshes? Nah, its location is still at the root.

Of all the…
Thank you…
I can’t believe I didn’t see something that basic.