hi i'm following a tutorial on youtube and they use this code to control the animation of the player whether it is idling,walking or running. why velocity.magnitude divides by speed?he said velocity magnitude is the current speed why is that the current speed?sorry i suck at maths Code (CSharp): float speedpercent = agent.velocity.magnitude / agent.speed;
Link to the tutorial would be better since you gave one line without context. So far I can assume that this value then used as a blend factor in the animation blend tree (0.2 would play the walking animation, 1.0 is running, everything in between will blend those 2 clips).