Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make a custom rig animate with a Humanoid?

I made a custom rig (It is an R15, holding a gun) and I animated it and then exported the animation to the website. Next, I imported the animation ID into an "animation" and tried using this script to play it on the custom rig:

wait(2)

s = script.Parent:LoadAnimation(script.Animation)
s:Play()

The script has the Animation as a child, and the script is a child of the Humanoid in the rig. This doesn't work. I also cannot use an AnimationController, because that requires no Humanoid. I need the Humanoid for the shirt/pants. Next, I tried a similar version of this script in the StarterPack in a LocalScript. Here it is:

wait(2)

local player = game.Players.LocalPlayer
local Mouse = player:GetMouse()

Mouse.KeyDown:connect(function(key)
if key == "r" then
s = player.Character.Humanoid:LoadAnimation(script.Animation)
s:Play()
end
end)

This one works fine, I set r to be pressed for the animation to play so I could personally test it multiple times. This works on my character, and doesn't work at all on the custom rig, what am I doing wrong?? I even built it on the rig, and my Character doesn't even have a gun. I'm totally confused.

1 answer

Problem solved. Unanchor the HumanoidRootPart. So the reason I couldn't make it work is because when you're actually animating, you need the HumanoidRootPart anchored, and if you don't unanchor it, it won't work in an actual game.

This discussion is preserved as it was. New answers, comments, and votes are closed.