Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to set the priority level of a new animation?

I use a script to load a new animation, but stuff like jumping will cancel it. How do I change it's priority level to Action or Idle etc.?

player = game.Players.LocalPlayer
uis = game:GetService("UserInputService")


uis.InputBegan:connect(function(input,process)
    if input.KeyCode == Enum.KeyCode.T then
	local char = player.Character

		local dance = Instance.new("Animation")
		dance.AnimationId = "http://www.roblox.com/asset/?id=1940452921" --- type here the animation ID
		local animloader = char.Humanoid:LoadAnimation(dance)
		animloader:Play()
		
	end
end)	

1 comment

2 answers

✓ Accepted answer

To prevent default to overlapping the custom, you simply have to reopen up your animation editor, load in your animation again (Import), then press settings, click Priority and make sure it's Priority is "Action". This ensures that it overlaps any animation. Read here for more information on Priority: http://wiki.roblox.com/index.php/Animations#Priority

Hoped this helped! best of luck!

Before line 12 insert this: animloader.Priority = Enum.AnimationPriority.Action

This discussion is preserved as it was. New answers, comments, and votes are closed.