Tried but still nothing in output and won’t work.
Won’t work, nothing in output.
Can you make sure that the NPC isn’t anchored?
You shouldn’t use the other code samples in this thread if the first one given doesn’t work. The first one will work if your setup is correct. If it doesn’t work for you, your rig isn’t set up right.
Check for:
- Correctly indexing the Humanoid
- Does the script actually run? Is it maybe disabled?
- Is the rig anchored? (it shouldn’t be anchored)
Here are some suggestions,
Make sure that the animation belongs to you, if you are doing a group game, upload that game to that group.```
Animation is in the group, game is in the group, and I am owner of the group but I cannot take the animation for some reason nor make it for sale by configuring it.
You should try importing it using Moon Animation Suite plugin or ROBLOX Main one. After that export it again to your group.
Are you trying to make so that the npc load the animation ingame?
I am trying to make that NPC does the animation, what do you mean by him loading the animation?
Loading basically makes the npc ingame shows the animation.
Basically that.
Hey sorry for being pushy but can you make sure that none of the parts in the NPC are anchored. It’s a pretty common problem in a lot of the “animation won’t play” threads.
For the humanoid,
local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/Asset?ID=(animation)"
-- Local variables
local animTrack = nil
local canPlay = script.Parent:findFirstChild("CanPlay")
function playShockAnim(Source)
if canPlay then
local playAnimation = game.(model).Character
canPlay.Value = false
animTrack = game.Destrioggok.Humanoid:LoadAnimation(animation) -- Load animation into Humanoid
animTrack.KeyFrameReached:connect(function(keyframeName) -- Bind function to KeyframeReached event
if keyframeName == "end" then
canPlay.Value = true
end
end)
animTrack:Play() -- Start the animation
end
end
script.Parent:WaitForChild("CanPlay").Changed:connect(playShockAnim)
What I did above is : I created a BoolValue to store the canplay ability. If the NPC touches the part , the BoolValue will transfer to the person or Humanoid that touched it.Then if the Canplay ability is true , the animation plays.
Everything is anchored.
Then unanchor them! Anchored parts won’t move.
It shouldn’t be anchored! Only HumanoidRootPart has to be anchored. Everything else must be anchored to false!
Note: the humanoid has to be unanchored.
Now infinite yeld is possible
Could you show us the whole output?
Here’s a pretty solid suggestion:
Use the script that buildthomas suggested in the first reply, and this time make sure that none of the parts in the NPC are anchored.