REPOST: I asked a question in the other one and nobody answered to it afterwards.
You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
R6 model to play animation
What is the issue? Include screenshots / videos if possible!
animation is not playing.
What solutions have you tried so far?
Change animation priority.
Did you look for solutions on the Developer Hub?
Yes. Did not work…
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
function playAnimation(humanoid, animationId)
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://"..tostring(animationId)
humanoid.Animator:LoadAnimation(animation):Play()
end
playAnimation(someHumanoid, someAnimationId)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
First of all, is the animation under the game you’re currently working on? Second of all, consider keeping the code where you set the animation priority.
Doing LoadAnimation returns an AnimationTrack. You can use this to change the priority.
function playAnimation(humanoid, animationId)
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://"..tostring(animationId)
local AnimTrack = humanoid.Animator:LoadAnimation(animation)
AnimTrack.Priority = Enum.AnimationPriority.Action -- I am going to assume you need this Priority
AnimTrack:Play()
end
playAnimation(someHumanoid, someAnimationId)