Stopping a walking NPC

Hi! I’m trying to establish a dialogue system when a walking NPC stops and the dialogue starts when I press E. The issue now is that when I press E, the NPC stops moving but still has the walking animation instead of idle. I think the issue is the animation blueprint but I can’t figure out how to fix it, as in, how to link the NPC’s speed to the blueprint. This is how it looks now: (when I promote Speed to variable it changes to the idle animation when moving and stopping and there is nothing in the Event Graph)

And this is how it looks when playing, the angle would be an issue as well, I guess it’s because it is angling towards the root instead of head?

Thank you!

If you split the set actor rotation pin and just use Z it should stop the rotating at an angle. The animation will keep playing until the Speed variable in your AnimGraph gets set to 0. Setting max speed for the movement component won’t change the variable on its own. It’s hard to tell what you are going for with the screenshots, the speed variable may not even be plugged in… it’s just always set at 385.

1 Like

When I put the speed variable and connected it to the blendspace in the blueprint, it automatically set the speed to zero and the NPC was sliding across when walking, which is why I put the speed there as 385 for now. Is there a way to make the blueprint so that the speed variable changes when I tell it to?

If you split the set actor rotation pin and just use Z it should stop the rotating at an angle

Sorry could you explain how to do this?

If you right click the blue “new rotation” pin on the set actor rotation node you can split it open, same with the find look at rotation node. Split them both and only plug in Z.

There is a few different ways to set the speed but better off with tutorials for that cause you will end up with more questions.

That works great, thanks! I found a good tutorial now that I know more what I’m looking for

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.