Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Each seat has it's own animation?

Asked by
didsaf 0
4 years ago

So recently i visited Vibe Train and saw that it has a cool feature - there is a different animation for each seat. I know how to make animations and make them play, but i can't seem to put different animations for another seats. My first animation applies for every seat.I didn't find any information about how to do this. I need help.

I'm very new to creating games though and i know nothing about coding, so if you're to help, please tell me exactly what to do.

1 answer

Log in to vote
0
Answered by
moo1210 587 Moderation Voter
4 years ago
Edited 4 years ago

Use the Occupant Property on the seat and then load the animation on that humanoid. Heres an example below:

 seat:GetPropertyChangedSignal("Occupant"):Connect(function()
    local humanoid = seat.Occupant 
    if humanoid then
        animation=humanoid:LoadAnimation(animationlocation)
        animation:Play()
    end
end)

You will need to change both of the seats to where your seat is located of course and change animationlocation to an animation instance

Ad

Answer this question