I have a key set to stop the player pawn from moving while it’s held down. I accomplish this using the “Stop Active Movement” node. However, once I release the key, the player pawn continues to move towards the previous hit location.
I want to reset and/or clear the NavMesh destination/waypoint on my player pawn when the key is pressed. How can do this?
Here’s how the relevant nodes look currently:
I’m thinking there’s some ‘cancel destination’ node I can fit in between ‘Stop Active Movement’ and ‘Attack’, but I don’t know how to find it.
That is a known issue with Simple Move To. It will keep the destination no matter what you tell it to do until it reaches the destination.
You will want to use an AI Move To instead. That will allow you to control cancelling the destination.
Please let me know if this helps.
The AI Move To seems to only take an AIController as the target though. Is there some way to cast the player controller to an AIController?
If it helps, my player controller is based off of the Top Down Template controller.
In that case you can just use a “Stop Movement” node to override the movement and reset it. Please let me know if that works for you.
The “Stop Movement” node seems to requires an AIController too unless I’m mistaken:
I also just tried the “Stop Movement Immediately” node and while it stopped the player pawn, it didn’t reset the waypoint either.
The problem there is context sensitivity. Are you in the player controller when you made this node? I just made a new top-down template and got this to stop my character in the player controller BP:
Hrm, are you using 4.2? When I make a new 4.1.1 top-down template game and go into MyController, the “Stop Movement” node doesn’t show up under context sensitive:
I have to uncheck context sensitive to have that node appear, and then when I place it in my blueprint the target is set to AIController again.
Updating to 4.2 seems to have fixed the problem. I can use Stop Movement with a player controller now. Thanks!
Another option would be to tell the pawn to “simple move to location” its current location, which will effectively stop movement.
Stop Movement is now available for the Player Controller blueprints in 4.2 and would be the better solution in this case.
June 9, 2014, 3:34pm
Thank you Steve; that is awesome!