local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local animator = humanoid:WaitForChild("Animator")
local idle = game:FindFirstChild("ReplicatedStorage").Animation.Combat:FindFirstChild("Idle")
local idleTrack = animator:LoadAnimation(idle)
idleTrack.Looped = true
script.Parent.Equipped:Connect(function()
idleTrack:Play()
end)
script.Parent.Unequipped:Connect(function()
if idleTrack.IsPlaying then
idleTrack:Stop(0.2)
end
end)
#Why does it not work?
1 messages · Page 1 of 1 (latest)
local idle = game:FindFirstChild("ReplicatedStorage").Animation.Combat:FindFirstChild("Idle")
Could be the problem because if any of the chain is missing the whole experssion wil turn nil or fail
there are no errors
local idle = game.ReplicatedStorage:WaitForChild("Animation"):WaitForChild("Combat"):WaitForChild("Idle")
Is what i would recommend using
Alr
And keep the whole chain with :WaitForChild()😭
still
Yeah but it is just fast typed
it was just an example
Btw just try to debug it
e.g. using prints
print(idle.AnimationId)
check from there
try to see where it goes wrong
Up
i would try to see if ur animation id actually exist lmao, when beginning i had that problem once
like with print("AnimationId:", idle.AnimationId)
Those small things could be the problem
it exists
I recommend to do just set looped to true
** You are now Level 11! **
and start the animation continuously when u start the game
man it dosen't work
Im pretty sure that there is a crusial detail that detemines if animation works or not
Something that we dont know
I always check if the Animator exists
it works on a npc
Is there another animation playing?
On that char
You can only have 1 Animator, if you have multiple Animators it wont work
Like per Humanoid
local animator = humanoid:FindFirstChildOfClass("Animator")
if not animator then
animator = Instance.new("Animator")
animator.Parent = humanoid
end
local idleAnim = ReplicatedStorage:WaitForChild("Animation"):WaitForChild("Combat"):WaitForChild("Idle")
local idleTrack = animator:LoadAnimation(idleAnim)
idleTrack.Looped = true
idleTrack.Priority = Enum.AnimationPriority.Action
script.Parent.Equipped:Connect(function()
print("Tool equipped, playing idle animation")
idleTrack:Play()
end)
-- Unequip handler
script.Parent.Unequipped:Connect(function()
print("Tool unequipped, stopping idle animation")
if idleTrack.IsPlaying then
idleTrack:Stop(0.2)
end
end)
see
It prints your debug shit?
animator.AnimationId = "rbxassetid://YOUR_ANIMATION_ID"
local track = animator:LoadAnimation(animimator)
"Tool Equipped"?
I do not have your file
Im helping blind
I do not know what is happening to your studio
I was talking to @sand stream
yes
print("Tool equipped, playing idle animation")
this part dosen't print
Well
As i thought
Does your tool have a part called "Handle" if not, then there is your cause of it
Bascially tool requires a handle, without it it wont work. To change it just turn this option off in tool properties
If u have turned on "RequiresHandle" any signal won't work unless u don't parent a handle to it
did it alr
and still
i tried simplifing it, being more specific, changing the avatar settings
but still
yes
yes