NPCs collide with collider but player does not

I want to put in a box collider in an area.

have NPCs wander around in that area and collide with the box

but not have the player collide with it. how do you do that? is it layering?

I added an image to illistrate my question. I want the NPC to wander around inside the collider and not leave the area… I then want my player to be able to move in and out of it. oh, forgot, this is also a trigger for spawning in the same area.

sorry bout that last part.

the answer is physics layers … a critical part of any game engine.

Unity’s implementation is beautiful.

Layer-Based Collision Detection.

Also go to for many beginner essays on this.

Also search here “layers physics” for 100s of questions about it.

Enjoy !