Changing Idle animations will not play immediately, but only after doing another action

So, I did this to change the idle animations:

player.Character.Animate.idle.Animation2.AnimationId = “rbxassetid://9645073757”
player.Character.Animate.idle.Animation2.AnimationId = “rbxassetid://9645073757”

This script runs when the character is already in the idle-state, and while standing still nothing happens. As soon as i run/jump the new idle animation is being played correctly.

I want the new animations to run immediately

I’ve tried to add the following code:
local anim1 = player.Character.Humanoid:LoadAnimation(player.Character.Animate.idle.Animation1)
anim1:Play()

This does actually change the animation immediatly, but the problem now is that the character is stuck in that animation even when it starts to run/walk

1 Like

I partly solved it, but I am not sure this is the best solution:

After changing the animations in the server script, I send a remotevent to the local player. I then have a localscript running this code:

game.Players.LocalPlayer.Character.Humanoid:ChangeState(Enum.HumanoidStateType.Landed)

There is still one problem. Even though this fixes it for the player, the animations does not display correctly for other players watching my player move. They actually see an animation change, but the change is different from what I see as a local player (basically the local player sees the arm goes straight forward, but other players see it as arm going forward but slightly down)

2 Likes