How would I create an NPC hitbox?

I want to create a hitbox around the NPC so that I could disable the other body part collisions to reduce lag. I tried to create a part that is anchored while being cframed at the root part but that didn’t stop it from hitting other NPC’s. Welding a hitbox to the root would stop it from walking up slopes and stuff so I need a better way of doing this.

I would just weld it, though do it this way:

  • Make sure to set the part to massless in properties, so it doesn’t affect the physics of the NPC
  • Create a new collision group named something like “NPC Hitboxes”
  • Set the collision group so it doesn’t collide with anything besides itself (ie other NPC hitboxes)
  • Set all the NPC hitbox parts to be of the NPC hitbox collision group

This makes it so the hitboxes can only hit each other (not the terrain or anything that would get in the way) and makes it so the hitboxes don’t affect the physics of the NPC.

Here is a collision groups tutorial from the docs:

1 Like

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