I have a blueprint actor which I’m moving around using AddMovementInput. I’m using the Flying movement (it’s an airplane), which has no gravity. For realistic purposes I still want some sort of gravity force, so I have an AddActorLocalOffset function at the Tick event. The AddActorLocalOffset adds a downward movement according to a simple formula.
The airplane is supposed to crash if it hits the ground (or any object really) if velocity is over a given limit. Which works if I manually drive the plane into the ground. But not if my simulated gravity brings it to the ground.
When I’m troubleshooting this I’m surprised to find out that AddMovementInput updates the velocity (GetVelocity). AddActorLocalOffset does however NOT update velocity. The Z velocity reads zero when the airplane is in free fall towards the ground.
Which is the reason to why the crash event fires when I manually drive (AddMovementInput) the plane into the ground, but not when it falls by “gravity” (AddActorLocalOffset) to the ground.
Is this by design, or do I somehow have to tell AddActorLocalOffset to also update velocity?