-
What do you want to achieve?
I have a customer character which I am moving around the world by changing the CFrame of the HumanoidRootPart. -
Structure of character:
- Only the HumanoidRootPart is anchored.
- The rest of the parts are either welded or rigged.
- The PrimaryPart of the model is set to HumanoidRootPart.
- Animation priority is set to Action.
- It is inside a Group game, and the animation is published under the group.
-
What is the issue? Include screenshots / videos if possible!
This is the animation I am trying to run:
The character tweens (Via CFrame of HumanoidRootPart) but does not run the animation.
- What solutions have you tried so far?
- I have tried all the requirements I could find for AnimationController, and the rigging is fine I believe because it allows me to animate the character in Animation Editor just fine and export that.
The following script is executed when the character has been added to the Workspace. It is run on the server-side, as per AnimationController | Roblox Creator Documentation
function animateCustomer(newCustomer)
if not newCustomer then return end
local animControl = newCustomer:WaitForChild("AnimationController");
if not animControl then return end
local animator = Instance.new("Animator");
animator.Parent = animControl;
if not animator then return end
local idleAnimId = animControl:GetAttribute("IdleAnim");
if not idleAnimId then return end
local idleAnim = Instance.new("Animation");
idleAnim.AnimationId = idleAnimId;
_UF.AnchorObject(newCustomer); -- This anchors the HumanoidRootPart
local animTrack = animControl:LoadAnimation(idleAnim);
animTrack.Stopped:Connect(function()
print("Why did the animation stop?")
end)
animTrack.DidLoop:Connect(function()
print("Looping?")
end)
animTrack:Play();
end
Debugging info:
The “Looping?” gets printed multiple times. But nothing happens.
What am I missing here?