Why doesn't StopMovementImmediately actually stop movement?

Using the top down template:

Adding the node “StopMovementImmediately” when the user presses G (G used as an example, this could be any event) only stops the movement of the character temporarily, but after this temporary interruption, the character continues along it’s path as if it had not just been told to stop movement.

Is there a node that I am simply missing that can be used on the character movement component to stop movement permenantly, or is this not the intended behavior of StopMovementImmediately?

Any help would be greatly appreciated.

As API refrence describes:

“Stops movement immediately (zeroes velocity, usually zeros acceleration for components with acceleration).”

It just zeros the the movement variables, but won’t stop them to be set again, so you got something that orders object to move again. Considering you saying character, this function might be too primitive for a character which might have some AI or other system that immidietly adds something to zeroed velocity and accleration

Hey , thanks for responding.

Trying to figure out exactly how the function that is actually doing the movement (SimpleMoveToLocation), does the movement, because it could very well be that the function sets some navigation target that the character will continue to try to move to every frame until it has reached it. Looking in the documentation for the navigation system, I haven’t found anything that seems to clear this target, if it exists.

I’ll keep looking, but if you have any further knowledge regarding the Navigation system, please don’t hesitate to share :slight_smile:

Check out engine source code, look on functions you use there (blueprint nodes are refrence to real C++ funtions in engine) it might give you a hint

I’ve done more searching in the source and found a few functions that are only suitable for AI Controllers, not PlayerControllers. I’m going to ask a separate question about that, and hopefully I’ll receive an answer there. I’m not going to mark this as resolved, but if I get an answer in the other question, i’ll update any new information here.

1 Like

Trying to figure out exactly how the
function that is actually doing the
movement (SimpleMoveToLocation), does
the movement, because it could very
well be that the function sets some
navigation target that the character
will continue to try to move to every
frame until it has reached it. Looking
in the documentation for the
navigation system, I haven’t found
anything that seems to clear this
target, if it exists.

As pointed out, StopMovementImmediately() only stops movement at that period in time, but if you have activated path following (via SimpleMoveToLocation) then that system continues applying forces to move to the requested destination. In this case you will also want to cancel the requested move.

Another problem:

IF you used SimpleMoveTo( ) to begin the movement, you also has a PathFollowComponent affecting your character, I just got the character to “realiably stop” by calling StopMovementImmediately( ) and also getting his pointer and calling AbortMove(TEXT(“Because I want!”)) and after “reiniting” it with InitializeComponent( ).