Hi! So, I’m having an error when executing the script for the NPC to play the animation ( nothing appears in the output )
Can anyone tell me why this happens?
Script :
local Char = script.Parent
local Anim = Char.Humanoid:LoadAnimation(script.Animation)
Anim.Looped = true
Anim:Play()
Where is the script? And also, just to make sure, you did set the AnimationId for the animation object right? Also, is this experience under your name or under a group? and is the animation saved to your group or under your account?
did you try debugging the code? insert a print(‘done’) after the animation:Play(), i dont think thats the problem but that still help on my codes sometimes
local Character = script.Parent
local Humanoid = Character:WaitForChild("Humanoid")
local Animation = script:WaitForChild("Animation")
local Track = Humanoid:LoadAnimation(Animation)
repeat task.wait() until Track.Length > 0
Track.Looped = true
Track:Play()
The actual issue was instances having not yet replicated to the client at the time of the script’s execution.
but it did, yes I think the looped property was not replicated to the client at that time.
but when i exported the animation with loop enabled it worked