Hi, i want to use an AI with a Animationblendspace that changes Animation based on movementspeed.
How can i tell the current movementspeed of the actor ? I am currently using a getvelocity and divide it by 100 but that still seems to be a bit off. Is there a way to calculate this ?
Is there a specific reason that you use VectorLengthSquared node instead of VectorLength?
The GetVelocity node works fine. In order to get the actual amount of velocity, you should use GetVelocity → VectorLength which gives you a single float value representing the speed of your character in (Unreal_Units / s). Unless you have a specific reason, I suggest you work with the Unreal Engine default units for the length which is in centimeters.
If for any reason, this doesn’t give you the value you want, you can very easily calculate its speed in every frame. Start by creating a float and Vector variable in your character blueprint. Let’s name them CurrentSpeed and PreviousLocation. Next, calculate the speed using Tick Event as in the following: