I’m currently trying to replace some animations inside the
Animate localscript in game. I’m experienced annoying issues with
Basically for some reasons, when setting the new animation while not moving nothing changes. Tried to change it both on server and client, didn’t work.
Following that, I tried to stop the tracks of the previous idle animations. The tracks were indeed stopped but my character would just remain frozen and no new animations were playing unless I’d move.
I solved this issue by making my character jump in order for the animation to update and I shouldn’t have to rely on methods like that, this is a big joke. At least it works, but I’d like to know if there’s a more efficient way.
What I currently have
I’m also obviously using the default
Animate localscript and I don’t plan on making my own for a little issue like that.
Just Play the idle animation yourself if
Humanoid#GetState() == Enum.HumanoidStateType.Idle
There is no HumanoidStateType named “Idle”, also it’s
Your best way to detect if the humanoid isn’t moving is by getting the magnitude of the velocity of the HumanoidRootPart, or you can use the
Unfortunately I’ve always had this issue too (Changing idle animation in-game doesn't work and note that this is from July), and there’s no easy way of fixing it except changing the animate script by ourselves.
-- Change Idle animation ID
if Humanoid.MoveDirection == Vector3.new(0,0,0) then
Why wouldn’t this work @DEVLocalPlayer?
I didn’t say it wouldn’t? I even mentioned it in my post
If you use mine, it’s an easy way and there’s no need to change anything in the animate script is what I meant.
You did not understand what I meant. There’s no “Idle” HumanoidStateType, so you can’t use
Humanoid:GetState() == Enum.HumanoidStateType.Idle.
Okay, so I found a solution.
How to works, is it checks if an ID was changed for any Animation Instances in Roblox’s default animate script then changes its humanoidStateType to update the animations, so I grabbed the animate script and added the code under the “connect events” as seen in the image. I don’t know if this is the most efficient way, so please if someone has something else that works just as smoothly and similar to this then please, let us know.
I hope this helped you guys.
for i,v in pairs(script:GetChildren()) do
for i2, anim in pairs(v:GetChildren()) do
if anim:IsA("Animation") then
Not to bump this but if anyone knows a more efficient way please post it here for other people as well as myself because there may be cases in the future where the client needs to know if you’re landed or any other state etc… but this is a working solution if you need your animate animations updated. I Believe maybe you could make a way to call the function that updates the animate script in other scripts but it’s still annoying like sheeesh.
I tested your method and it seemed to work, but since the Humanoid’s State changed on Client, others will not be able to see it.
Thank you for letting me know, I guess you’d have to find the script in the character from a server script and run the code from there. That should solve that issue. If you need any help, let me know.