Hello, I am trying to make a script which makes an NPC use the exact animation the player is using currently. For example if the player is idling I want the NPC to use the exact same idle animation at the same time, and if the player is walking I want the NPC to use the walking animation at the same time. How could I do this?
I suggest you look into Humanoid:GetPlayingAnimationTracks().
This is used to an array of playing animations.
You can read up more about it here: https://developer.roblox.com/en-us/api-reference/function/Humanoid/GetPlayingAnimationTracks
Hello there @CrazyCorrs.
There is a multiple of ways of doing this, some easier and shorter than others, but if you are new to animations you would simply do what ABrittishChap suggested, although before commenting on this forum we do advise you google and view the documentation before asking questions here.
The answer to your question relies in the properties of the animation track that is currently stopping and starting, although this method would get buggy you could do.
animation.Stopped:wait()
or you could do.
animation.IsPlaying()
Bare in mind IsPlaying() does not replicate across the server and client boundary. thanks I hope I helped a little bit.
Have a wonderfull day!