Do animations adjust to speed?

Hey there!

If i add a custom run animation, and someone on mobile goes slow, would the animation adjust to the speed?

Any help is appreciated!

1 Like

Hi, there,
I am c0nzx, and I found something on the roblox dev hub, that might answer your question.
https://developer.roblox.com/en-us/api-reference/function/AnimationTrack/AdjustSpeed#:~:text=However%20a%20track’s%20Speed%20can,the%20length%20by%20the%20speed.

You can use AnimationTrack:Play.

I hope it helped, if it did make sure to mark my answer as solution, thanks, and enjoy developing!

1 Like

No, it wouldn’t iirc.
303030303030

1 Like

Yes, the animation speed is adjusted based on the humanoids traveling speed. Just make sure you put this custom animation in walk as well as run, because the walk animation is what is played at slower speeds.

( If you are using the default animation script. )

1 Like

Is there anyway i could make the animation speed adjust based on the humanoids travelling speed when using a custom script that simply plays the walk animation when the MoveDirection’s magnitude is above 0?

You can likely just use the same code that is in the default script. When the humanoid walks, an event is fired passing a speed parameter. The animation speed is adjusted based on this speed parameter using some simple maths, and then played.

1 Like

Thanks for the help @KeysOfFate @c0nzx.

I managed to adjust the speed of the animation according to the humanoid’s walkspeed by dividing the speed the humanoid is currently at by the humanoid WalkSpeed, setting the value as a variable called ‘AnimSpeed’, and using :AdjustSpeed(AnimSpeed).

No problem, also credit roblox, their the one who let me use their developer source page! Haha! Good luck!

1 Like