Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to set the priority level of a new animation?

Asked by 6 years ago
Edited 6 years ago

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)    

2 answers

Log in to vote
0
Answered by 6 years ago

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!

Ad
Log in to vote
0
Answered by 4 years ago

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

Answer this question