Best way to animate a NPC laying in/on top of a bed?

Hi everyone, have been looking for a solution to this for a while now.

In my game I want NPCs to be able to be animated so that they can lie down in a bed, sit up in it (as if they’re watching TV) and other actions.

I want the NPC to be animated, not just CFramed / Welded to the bed so that their body parts can move e.g head moving in bed.

What I am currently doing is CFraming the NPC to a position on the bed and then playing a simple animation which makes them lie down. However, the problem here is that because the bed is collidable, you can’t push them into the bed to make it look as if they are in the bed else they will glitch out.

And if you set the bed to be uncollidable, the player will just fall through the bed into the floor. Anchoring the player won’t work because then the animations will not play.

I need a way for the NPC to be welded somehow to the bed so that I can play an animation to make them lie down / sit down so that it can be realistic.

Any ideas / suggestions?

8 Likes

Dear AlvinBlox,

Wouldn’t welding just the humanoidrootpart to the bed work?
On the server the bed can be non-collidable but on the client it can be collidable too.

Sincerely,
URURAWRZDAD

3 Likes

I agree with that, HumanoidRootPart being welded down to bed wont restrict head movement i don’t think.

1 Like

If you just anchor the HumanoidRootPart then you will be able to CFrame the player and have all animations play.

1 Like

Not sure if this will work but you might be able to anchor the humanoid root part you can still use animations.