I’m currently trying to replace some animations inside the Animate localscript in game. I’m experienced annoying issues with Idle animations.
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.
There is no HumanoidStateType named “Idle”, also it’s Humanoid:GetState().
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 Humanoid.MoveDirection.
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.
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.
spawn(function()
for i,v in pairs(script:GetChildren()) do
for i2, anim in pairs(v:GetChildren()) do
if anim:IsA("Animation") then
spawn(function()
anim:GetPropertyChangedSignal("AnimationId"):Connect(function()
Humanoid:ChangeState(Enum.HumanoidStateType.Landed)
end)
end)
end
end
end
end)
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.
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.
You have network ownership over the character, any changes you make on the character on the client replicates to the server.
EDIT: Nevermind, humanoid states do not replicate to the server, if you want to change the humanoid state you should do it both on the client and the server, using remote events or something.