Hey everyone. A friend and I are trying to make a cup that you can click to “Drink” by plating an animation that pulls the cup towards the mouth and then away. We’ve gotten the R6 animation to work and play, yet despite many efforts we have been unable to figure out why the R15 animation won’t play when clicking to play it. Below I’ve provided the script we’re using as well as a screenshot of the tool setup. I was wondering if there is anything that could be preventing the R15 animation from plating?
Here’s the script:
local Tool = script.Parent
local DrinkAnimationR6 = Tool.DrinkAnimationR6
local DrinkAnimationR15 = Tool.DrinkAnimationR15
local AnimationTrack
Tool.Activated:Connect(function()
local Character = Tool.Parent
if Character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
AnimationTrack = Character.Humanoid.Animator:LoadAnimation(DrinkAnimationR15)
AnimationTrack:Play()
elseif Character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
AnimationTrack = Character.Humanoid.Animator:LoadAnimation(DrinkAnimationR6)
AnimationTrack:Play()
end
end)
Tool.Unequipped:Connect(function()
if AnimationTrack ~= nil then
AnimationTrack:Stop()
AnimationTrack = nil
end
end)
And here’s a picture of the object in explorer: