Play animation on loop ignoring walking or jumping anim

Hello, I made an animation of a player sitting down, and i want to play this animation always while player is moving or also jumping. I just want the player to sit down and move with his walkspeed. here the code i have but the animation dont work.
LocalScript in StarterPlayerScripts:

local player = game.Players.LocalPlayer  -- O referencia al jugador específico
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")

local sitDown = Instance.new("Animation")
sitDown.AnimationId = "rbxassetid://15017119691"
local cheerTrack = humanoid:LoadAnimation(sitDown)
cheerTrack.Looped = true
cheerTrack:Play()

1 Like

Try to set the animation track’s priority to Action or higher, it should override the running and jumping animations

cheerTrack.Priority = Enum.AnimationPriority.Action -- or Action2/3/4
cheerTrack:Play()
2 Likes

Mmm I tried with all, including Action4 and nothing happens, the player just play the animation 1 time and stand up again and play idle animation :frowning: This is the code i have rn:

local sitDown = Instance.new("Animation")
	sitDown.AnimationId = "rbxassetid://15017119691"
	local animationTrack = Hum:LoadAnimation(sitDown)
	animationTrack.Priority = Enum.AnimationPriority.Action4 
	animationTrack.Looped = true
	animationTrack:Play()

I don’t know why but decided to work using wait(2) before playing… :sweat_smile:

local player = game.Players.LocalPlayer  
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")

local sitDown = Instance.new("Animation")
sitDown.AnimationId = "rbxassetid://15017119691"
local sitTrack = humanoid:LoadAnimation(sitDown)
sitTrack.Priority = Enum.AnimationPriority.Action4 
sitTrack.Looped = true
wait(2)
sitTrack:Play()

The character probably didn’t load properly yet when the script runs, you should mark yourself as the solution to help other people having a similar problem :slight_smile:

Thanks anyway! Without ur hint I couldn’t solve my problem haha :smiley:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.