I am not using a Humanoid object, instead I am using the AnimationController. It’s not a GamePlayer animation, just a custom animation I would like to run during gameplay, preferable with a button. Meaning, you click a button, the animation starts. You click the button again and the animation stops.
It’s a custom rig and animation from the mixamo platform.
Here is my script:
local animationController = script.Parent.Parent:FindFirstChild("AnimationController")
if not animationController then
error("AnimationController not found")
return
end
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://16747289882" -- Your animation ID
-- Load and play the animation
local animationTrack = animationController:LoadAnimation(animation)
animationTrack:Play()
The animation is playing in runtime. But there is one hiccup.
It looks like the characters world position does not change, and the mesh is “stuck.”.
It looks like the root bone is blocked or prohibited to move in world space.
The animation runs great within the Animation Editor. However, in game-play mode, the mesh doesn’t seem to be able to use the root bone animation keys.
It’s hard to describe, and much easier to see when you smash the play button.