[SOLVED] Seat:Sit() not working properly with cloned character

In a game I’m working on, I need a static clone of the character, as well as the original character. I’ve managed to clone the character using the following code:

local Character = game.Players:FindFirstChild(PlayerName).Character
Character.Archivable = true
local ClonedCharacter = Character:Clone()
Character.Archivable = false
ClonedCharacter.Archivable = false
ClonedCharacter.Parent = game.Workspace
local ClonedHumanoid = ClonedCharacter:FindFirstChild("Humanoid")

This works, and the cloned character appears in the Workspace right next to the real character. However, I need to make this clone sit on a seat, but when I run the following code, it doesn’t quite work.

Seat:Sit(ClonedHumanoid)
wait(0.1)
ClonedHumanoid:ChangeState(Enum.HumanoidStateType.Seated)

First off, I have the ChangeState() line because for some reason, after running Seat:Sit(ClonedHumanoid) without anything else, getting the humanoid’s state with GetState() returns Enum.HumanoidStateType.Running - which doesn’t really make sense.

But the weird part is that the clone is teleported to the seat, has it’s humanoid state as Seated (only after using the ChangeState() function), but the animation just isn’t playing/didn’t play.
Instead the clone is just kinda standing on it.


As far as I can tell, everything points to the clone being fully seated on the seat, but it just doesn’t look like it. When I tried to replicate the same code with the actual playable character and not the clone, it worked fine. So I don’t think it’s a problem with the part (could be wrong).
Any help would be greatly appreciated. I’ve been at this for nearly two hours lol

(All of this code is run on the server by the way)

Can you check if the clone has a Script inside of it named “Animate”? (You can also check this by looking if the rig has any default animations like the idle one.)

I don’t think a character can “sit” properly without the “Animate” script. It will “sit” the character, but it won’t actually display the animation.

It does indeed have the Animate script.


However, I do notice it’s a local script. Seeing as the clone doesn’t have it’s own client, could this be a problem? If it relies on the Animate script to run the animations, but it’s local and also without a client, that sounds like it could potentially be an issue.
I’ll look it into myself, but anymore help or insight would be appreciated!

Just figured it out! It was indeed because the Animate script to load + run the animations wasn’t properly working since it didn’t have a client. I loaded the animation manually from the server onto the rig and it worked perfectly fine! Here’s the code I used lol

local Clone = ClonedCharacter
local Animator = Clone:FindFirstChild("Humanoid"):FindFirstChild("Animator")
local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://178130996"
local sitAnimation = Animator:LoadAnimation(Animation)
sitAnimation:Play()

Thanks for pointing that out! While it wasn’t necessarily the direct answer, it led me to the problem and solution! Much appreciated lol, thanks!

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.