So I am creating a simulator and most people know that when you are holding the tool or weapon and you click it plays and animation and gives strength. I am not focusing on the strength yet but I just need help on the animation. So the tool I am using is a wand and when you are holding it and you click, the animation will play. Everything is fine except for the animation. The animation won't play. The AnimationId is correct and and the animation is not nil. Everything but the "AnimationIsNil" is printing. I have moved some lines to other places and it still does not work. If any of you have a solution please tell me.
This is a local script in the StarterPlayerScripts
local mouse = game.Players.LocalPlayer:GetMouse()
local Character = game.Players.LocalPlayer.Character
if not Character or not Character.Parent then
Character = game.Players.LocalPlayer.CharacterAdded:Wait()
end
local Humanoid = Character:WaitForChild("Humanoid")
local Animator = Humanoid:WaitForChild("Animator")
local WandMovement = Instance.new("Animation")
WandMovement.AnimationId = "rbxassetid://6602046971"
local Tool = game.Players.LocalPlayer.Backpack:FindFirstChildWhichIsA("Tool")
Tool.Equipped:Connect(function()
print("ToolEquippedFUnction")
mouse.Button1Down:Connect(function()
print("IntoMouseButtonFunction")
local WandMovementAnimationTrack = Animator:LoadAnimation(WandMovement)
WandMovementAnimationTrack:Play()
if WandMovementAnimationTrack == nil then
print("animationtrackisnil")
else
print("AnimationIsNotNil")
end
end)
end)
Thank you for reading!

1 comment
Also the priority of the Animation is Action