Hello,
I made an animation for my future Showcase, the problem is;
I made an animation, who I want it to be loaded when the character is sitting on a seat, the problem is it doesn’t work, I searched in the Developer hub, tried a few improvements, but still not working.
Here’s the script:
local seat = script.Parent
local Anim = seat.sitanim
seat.Changed:Connect(function(property)
if property ~= "Occupant" then return end
local occupant = seat.Occupant
if occupant then
local character = occupant.Parent
while character.Parent == nil do
character.AncestryChanged:wait()
end
local humanoid = character:WaitForChild("Humanoid")
local animationTrack = humanoid:LoadAnimation(Anim)
animationTrack.Looped = true
animationTrack:Play()
end
end)
I’ll really appreciate if someone can help me.