How Can I Prevent Players From Moving an NPC

Thanks for taking a look at my situation, I’m trying to prevent players from physically pushing a Non-Playing-Character without anchoring it (which destroys the NPC’s animation). I’m trying as hard as possible not to use barriers placed around him.

So far I’ve tried creating a hitbox that completely engulfs the NPC and making it collideable from the client, but the NPC is affected by it. The PlatformStand property doesn’t prevent this and neither does any other property of the Humanoid.

Sorry if I lack knowledge or if this is a repost to a similar question - if so please link it to me!

7 Likes

Would it work to create collision groups to prevent physical player-NPC interaction? That would allow the NPC to move freely (especially if you want it to be able to walk) while still not being pushable.

16 Likes

Just anchor HumanoidRootPart and nothing else. This will allow animations to function as normal while leaving the NPC unmovable.

22 Likes

Thanks for the suggestion. I didn’t know the significance of this feature until now.

4 Likes

Duplicate thread tho:

and

2 Likes

I had a problem like this where my lute player was getting pushed around. Anchoring the HumanoidRootPart solves it.

1 Like

Shouldn’t one of the threads be locked? @Kiansjet

2 Likes

If there’s a duplicate thread, posts get merged over or conversation in one stops and continues in one of the open threads (if there’s still anything left to discuss). That’s normally my experience with it.

@OP

  • Anchor HumanoidRootPart
  • Collision groups
  • break joints of player who touched it

I think anchoring the HumanoidRootPart is the best solution if you have no intention whatsoever to move the NPC. You retain collisions with NPCs but you can’t push them.

2 Likes

Npc cant play animation when you anchor the HumanoidRootPart

1 Like

A. Yes they can
B. Please do not necrobump an almost 3 year inactive thread.

2 Likes

It’s been such a long time since this post, but thank you so much!! This really helped me out just now.

2 Likes