The animation priority is Action, yes.
When using the animator:LoadAnimation() method it returns an animation track you can reference like so:
βββ
local animationTrack = Animator:LoadAnimation(NewAnimation)
βββ
You then play the animation track using the method :Play() on the animation track to see the animation. For you it would look like:
βββ
local animationTrack = Animator:LoadAnimation(NewAnimation)
animationTrack:Play()
βββ
Donβt forget to mark this post as a solution if it works!
1 Like
Thank you! Could you tell me where in the script I would put this, please? :
--Varibles
local Tool = script.Parent
local Handle = Tool:WaitForChild("Handle")
local DrinkSound = Handle:WaitForChild("DrinkSound")
local OpenSound = Handle:WaitForChild("OpenSound")
local animId = "rbxassetid://7210431772"
local NewAnimation = Instance.new("Animation")
NewAnimation.Parent = Tool
NewAnimation.AnimationId = animId
NewAnimation.Name = "Drink Animation"
local ToolCooldown = 1
function ToolActivated()
local Character = Tool.Parent
local Humanoid = Character:WaitForChild("Humanoid")
local Animator = Humanoid:WaitForChild("Animator")
Animator:LoadAnimation(NewAnimation)
DrinkSound:Play()
wait(ToolCooldown)
end
function ToolEquip()
OpenSound:Play()
end
Tool.Activated:Connect(ToolActivated)
Tool.Equipped:Connect(ToolEquip)
Replace the
βββ
Animator:LoadAnimation(NewAnimation)
βββ
with:
βββ
local animationTrack = Animator:LoadAnimation(NewAnimation)
animationTrack:Play()
βββ
Glad I could help
1 Like