How to Play() a non-humanoid animation?

Hey, pretty much the title.
I’ve got a skinned mesh animation, and been trying to figure out how to play the animation, there’s no humanoid in the object, as I’d normally play animations via Humanoid.

Thanks in advanced!

4 Likes

Is this what you are looking for?

This is a replacement for a Humanoid when it is not needed to play an Animation.

If you have any questions feel free to ask!

2 Likes

EDIT: No worries I got it fixed and working, thanks for the link!

Hey, I believe I’ve set it up right but it isn’t working?
Just doesn’t play, and there’s no errors either

Here’s the code I added to the server:

local InsertService = game:GetService("InsertService")

-- Load a model for demonstration
local npcModel = workspace.FBXImportGeneric

-- Replace the humanoid with an animationcontroller

local animationController = Instance.new("AnimationController")
animationController.Parent = npcModel

-- Create and load an animation
local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/asset/?id=9664702848" -- Roblox dance emote
local animationTrack = animationController:LoadAnimation(animation)

-- Play the animation
animationTrack.Looped = true
animationTrack.Changed:Connect(function()
	print("smth changed.")
end)
animationTrack:Play()

The animation is this:

2 Likes