How to trigger an event when actor velocity is 0

Hi, I’m new to UE4 and I have spent endless hours searching for an answer but cannot find one. As stated in the title I want to know how to make an event happen when my actor’s velocity is zero or stops moving. To be more specific I want my controller to rotate only when the actor stops moving. Any help would be great and thanks in advance.

i dont believe there is a built in function for that but all you really would need to do is to get the velocity at a regular interval (timer or tick). or you could have the rotation as the default state and then tell it to stop rotating while there is input.

1 Like

This is 1 way you can do it, get your actor velocity, right click on return value and split struct so you can get the xyz values. (velocity is in vectors so you will have to split struct), then compare float with 0, when the values are = 0 you can set bools/custom events or what you think is suitable. But I don’t recommend using an event tick, you should use some kind of timer that checks at a less frequent rate.

to get the velocity of an actor… use Get Velocity and Vector Length…

(the length of the vector is the speed in centimeters per second, the normalised vector is the direction the velocity is going)

you might set the > to be a bit above zero, just to account for rounding errors

This is a better way to do it than the method I posted, I would recommend my method if you need to get velocity in a specific direction.

Sorry for not getting back to you guys. Thanks you so much for your help. I was able to create what I wanted. Once again THANK YOU!