How do I freeze/hold a pawn? Even in mid air? (TPP character)

Effectively I’m trying to remove velocity, or rather set it to “zero” on all axis for the player pawn. (to hold them in mid air)

Sorry if the title is too simplistic; I’m looking for a way to halt all motion a character is experiencing for a set amount of time. Character Movement is what I’m trying to freeze.

Imagine jumping, then holding a button to stop your motion (keeping you stuck in the air until you release said button).
It sounds like a strange goal, but I need this to do a lot of things in my game. Ideally, I want to control how long the character stays stuck in one place (possibly a timer of some kind as well).

Thank you for any assistance :slight_smile:

You can just set the velocity to zero in the character movement component.

Event tick doesn’t seem to stop all motion, it only slows the characters motion, but it’s still not a complete halt. It seems that Event tick isn’t fast enough, like the character is moving in between ticks.
EDIT: It seems that simply removing velocity isn’t enough to stop character motion, I have it set to Face Button Right, and it does hold the character in place…somewhat, the character is still able to move and fall, just ‘very slowly’ for some reason.**

Can you change it to a static?

I haven’t had any success trying to change it to static, I’m not sure if I’m doing it correctly though. However, I’m unsure if that method would lead to future consequences or not relating to other elements :confused:

Try this!

Set the ‘character movement mode’ to flying, and also drag the pin off of the ‘character movement’ Node and search for ‘stop movement immediately’

That should work if you then reset your movement mode to ‘walking’ afterwards when you need to start moving again.

EDIT: This is showing an issue when replicating. This method of freezing the character by changing the movement mode and using the ‘stop movement immediately’ Node - only works for the client if you use a custom event that runs on the server, otherwise the client’s movement mode just doesn’t change and the ‘stop movement immediately’ node only stops very briefly

What if I am In a vehicle driving it ? I cant set use Disable Movement or Set movement mode non because the character will just stop mid air while the train moves forward… unless I attach it to the Train witch seems to work but does not replicate well in multiplayer …

You need to, at a minimum, also turn off gravity for the body/bodies simulating the actor.
However, perhaps better, would be to deactivate the “simulate physics” property for the body/bodies.
Then re-active them when you want to start simulating again.
Might want to make sure to save the previous velocity and restore it when you resume again.

1 Like