How to Make Animations Update Without the Player Moving?

I have a weapon shealthing system in my game, but the animations does not update until players moves or updates their humanoid state in any way. This is especially annoying for my game since if the player shealths or unshealths, their animations stays the same until they move. This also affects the running animations since you can shealth while running. If you don’t stop moving, the animation won’t update. I’ve tried a few different methods of fixing this, but I can’t really get anything to work. My best solution so far is setting the player walkspeed to 0 when they shealth, but I don’t want it to work like that.

Here’s a video of what I mean

I change the animations by updating the animate scripts animations in the player’s character. Here’s the part that updates the id whenever the player shealths.

animate.walk.WalkAnim.AnimationId = AnimFolder.WeaponAnim[WeaponInfo[weapon].Type].Run.AnimationId	
animate.idle.Animation1.AnimationId = AnimFolder.WeaponAnim[WeaponInfo[weapon].Type].Idle.AnimationId
animate.idle.Animation2.AnimationId = AnimFolder.WeaponAnim[WeaponInfo[weapon].Type].Idle.AnimationId
animate.jump.JumpAnim.AnimationId = AnimFolder.WeaponAnim[WeaponInfo[weapon].Type].Jump.AnimationId	
animate.fall.FallAnim.AnimationId = AnimFolder.WeaponAnim[WeaponInfo[weapon].Type].Fall.AnimationId

Try using animation weights
Play(fadeTime: number, weight: number, speed: number)

If you play around with it you can sort of merge the walking and unsheathing animation.

If I don’t use AnimTrack:Play() to play my animations, how do I apply weight to it?

This works client-sided but the rest of the players won’t see it change

AnimationTrack | Documentation - Roblox Creator Hub Read here about the adjust weight function. Its always good to read roblox documentation when you need to better understandhow something works.

I don’t think your are getting my problem here. The problem isn’t about the weight of the animation. It’s that the roblox animate script only fire the functions to update and play animations when certain events (e.g. Humanoid.Running, Humanoid.Jumping, etc.) are activated. Because of this, the new animations from shealthing and unshealthing aren’t played until the script registers a change in the humanoid’s state.

1 Like

Ok so in your original post you explain the problem, but not how its intended to work. Could you please elaborate on what your trying to do?

Ok. I have different idle and run animations for all the weapons in my game. When I shealth and unshealth, I change the AnimationIds of the animations in the default animate script each character has. I’ve looked at the code inside the animate script and the running animation is tied to a Humanoid.Running function. Because of this, the new animations don’t play as the Humanoid.Running event doesn’t fire again until it detects the player stops moving.

1 Like

Create a new event that you fire to update the animations

Ok, I just made this change in the animate script. It correctly updates the animations on the client’s side, but not the server side. Can you explain why this doesn’t replicate to the server because I literally used the exact functions in the animate script to play the animations.

task.spawn(function()
	repeat task.wait() until #script:GetChildren() >= 10
	for i,v in pairs(script:GetChildren()) do
		for i2, anim in pairs(v:GetChildren()) do
			if anim:IsA("Animation") then
				task.spawn(function()
					anim:GetPropertyChangedSignal("AnimationId"):Connect(function()
						
						if anim.Name == "WalkAnim" and Humanoid.MoveDirection.Magnitude > 0 then
							playAnimation("walk", 0.1, Humanoid,true)
						
							if currentAnimInstance and currentAnimInstance.AnimationId == anim.AnimationId then
								local speed = Humanoid.Parent.PrimaryPart.Velocity.Magnitude
								if speed / 20 <= 1 then
									setAnimationSpeed(1)
								else
									setAnimationSpeed(speed / 22)
								end
							end
							
							pose = "Running"
						end
						
						if anim.Name == "Animation1" and Humanoid.MoveDirection.Magnitude <= 0 then
							if emoteNames[currentAnim] == nil then
								playAnimation("idle", 0.1, Humanoid,true)
								pose = "Standing"
							end
						end
						
					end)
				end)
			end
		end
	end
end)

Animation NOT Replicating - #15 by TomsGames This person had the same problem it seems they found a fix.

It doesn’t seem to work for me. Also doesn’t loading an animation require you to use Humanoid.Animator:LoadAnimation()? If that’s the case, the humanoid would already have an animator before the server could load it’s animation.

This is so confusing because if I used the same functions as the animate script to play the animations, shouldn’t they all work and replicate to the server? I mean the animate script itself plays the animations fine, but if that is the case, why isn’t my part of the script replicating?

You could try playing the animations on the server?