How do i load and play an animation on a local custom mesh with a humanoid

  1. What do you want to achieve? Keep it simple and clear!

Im trying to play a specific animation for each of 8 custom rigs (square blocks with faces) and make those rigs visible in a surfacegui using a viewport (thats why i need them to be local because i dont think you can do that on the server)

  1. What is the issue? Include screenshots / videos if possible!

No idea how to do it because the animations arent playing at all
This is an image of the hierarchy btw
image

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I tried looking everywhere and asked so many people been at this for like 7 hours now

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

This is the code for the animations, its a local script

local Folder = script.Parent
local PlayAnimationsEvent = Folder.PlayAnimationsEvent
local AllFaces = {
	Folder[":I 1"],
	Folder[":/ 2"],
	Folder[">:/ 3"],
	Folder["😖 4"],
	Folder[";I 5"],
	Folder[":< 6"],
	Folder[":> 7"],
	Folder[">:I 8"]
}
local Number = 2

PlayAnimationsEvent.Event:Connect(function()
	local Face = AllFaces[Number]
	local Humanoid = Face:FindFirstChildWhichIsA("Humanoid")
	local Animation = Face:FindFirstChildWhichIsA("Animation")
	local AnimationTrack = Humanoid.Animator:LoadAnimation(Animation)
	AnimationTrack:Play()
	Number += 1
	if Number > 8 then
		Number = 1
	end
end)
1 Like

I’m not an expert but don’t those go in player starter scripts?

they are inside the player because they are inside playergui so they should work (and putting the script inside player scritps or character scripts fixes nothing)

You need a WorldModel to play animations in viewport frames…
Im so dumb :neutral_face:

ik im late but how exactly did u end up doing it

you need to put a WorldModel inside the viewport and put everything that was in the viewport inside the WorldModel then the animations should play
image