How would I go about in making a NPC sit?

Hello Devs :wave:, I Was just wondering if it was possible for a NPC to sit down? If so how would I go about in doing this

1 Like

There’s a boolean, insidde humanoid. You can just enable that. Then, you need to make an animation for it (or the NPC will just do this)
Processing: a9798d3dd92373777a2bb82ca719ca88.png…

1 Like

Humanoid.Sit = true
This will make the NPC sit down wherever they are, to make them sit down at a specific place, I suggest you weld them to it, copy the RootPart of the npc to where you want it to sit, then, make a WeldConstraint between it and the part it should sit on,Have WeldConstraint.Part1 be the rootpart, now delete the spare root part and you will have the weldconstraint set up, update the behaviour in the code

function Sit()
    Humanoid.Sit = true
    WeldConstraint.Part1 = Humanoid.RootPart
end

This will make the npc sit, and weld it to the point where it should sit, to make it get up

function GetUp()
    WeldConstraint.Part1 = nil
    Humanoid.Jump = true
end

Hope this helps

1 Like

I made an animation how do i go about in making the sit anim play?

1 Like
local Anim = "PathtoAnim"
local Animator = Humanoid:FindFirstChild("Animator") or Instance.new("Animator",Humanoid)
local AnimTrack = Animator:LoadAnimation(Anim)
AnimTrack.Priority = Enum.AnimationPriority.Action -- Makes animation top priority
AnimTrack.Looped = true -- set to false if you don't want animation to loop
AnimTrack:Play()
1 Like

Thanks for help it worked! I appreciate it!

1 Like

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