I need help figuring out why my animation isn’t playing, there are no error codes, the animation and baseplate are both R15, and the animation is published to the same group as the game. The animation is a weight lifting animation that is lifting an arrow instead of a weight.
When I load into the play in Roblox studio, the strength goes up but the animation won’t play.
local tool = script.Parent -- Assuming the script is placed inside the tool
local animationId = "INSERT_ANIMATION_ID_HERE" -- Replace with the ID of the animation you want to play
local toolEquipped = false -- Variable to track if the tool is equipped
local function playAnimation()
-- Check if the tool is equipped and animationId is valid
if toolEquipped and animationId ~= "" then
local humanoid = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
local animator = humanoid:FindFirstChildOfClass("Animator")
if animator then
-- Load the animation
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://" .. animationId
-- Play the animation
local track = animator:LoadAnimation(animation)
track:Play()
end
end
end
-- Handle tool equipped/unequipped events
tool.Equipped:Connect(function()
toolEquipped = true
end)
tool.Unequipped:Connect(function()
toolEquipped = false
end)
-- Detect mouse click
game.Players.LocalPlayer:GetMouse().Button1Down:Connect(function()
playAnimation()
end)
Make sure to replace "INSERT_ANIMATION_ID_HERE" with the actual ID of the animation you want to play. Place this script inside the tool you want to use and it will play the animation when the player clicks the screen while holding the tool.
I tried that and even tried using this exact script but no matter what the animation never plays. Every time I’ve ever tried applying an animation this always happens.