Issue with changing the idle / walking animation of a player

legstatus:GetPropertyChangedSignal("Value"):Connect(function()
	pcall(function()
		if legstatus.Value == 1 then
			walk.AnimationId = legb2
			idle.AnimationId = idleanim1
			idle2.AnimationId = idleanim2
		elseif legstatus.Value == 2 then
			walk.AnimationId = legb3
			idle.AnimationId = legb4
			idle2.AnimationId = legb5
		elseif legstatus.Value ~= 1 and legstatus.Value ~= 2 then
			walk.AnimationId = walkanim
			idle.AnimationId = idleanim1
			idle2.AnimationId = idleanim2
		end
	end)
end)

This is my code. I have a system in place where if a player has a missing or broken leg it will change their idle / walking animation. However for some reason upon changing it the player will be stuck in the regular walking animation whenever they stand still. This only takes effect on other peoples clients (not their own) Why is this and how can I fix it?
(the code is run from a local script)

It’s probably due to the AnimationPriority type being wrong.

When you create an animation, you have to select the correct one or you will have that issue. In your case, you want Movement. Check this out:

1 Like

They dont play over eachother. They are meant to replace eachother so priority shouldn’t be the issue.
when I change the walkanim ID its changing the ID in the default animation script.
This is what gets changed
image
This is the code inside the Animate script.

image
I ended up finding out there was a stopAllAnimations() function inside of the default roblox animate script. So I made it stop all animations whenever they were going to get changed to prevent any bugs. Works like a charm.

1 Like