View Full Version : Bounding Box Problem

09-25-2009, 01:12 AM
More often than not, when I spawn an NPC using "npc_create", physics objects will not collide with large chunks of the newly created NPC.

I was able to visualize what was causing the problem by turning on ent_bbox (http://developer.valvesoftware.com/wiki/Console_commands) (it's suppose to show the bbox on the specified NPC(s)). According to the documentation the bbox is suppose to be orange. It always appears where you would expect it to be, but there is this yellow box that is sometimes floating above the orange one.

Through testing I found that physics objects will only collide with the part of the model that is inside the yellow box.

Projectiles like rockets and bullets aren't effected by this. I can shoot the model wherever I want, it's just physics objects that I'm having the problem with.

I implemented a keybind to spawn an npc using the E key and when I use that the yellow box is completely above the orange one, but if I just call the command through the console it's only partially out of alignment.

The other really frustrating thing is that this appears to be somewhat random. However, if I place an NPC on a hill or on a non-flat surface it always seams to make the yellow box line up with the orange one, but if I place the NPC on the ground the boxes will only sometimes line up.

I need to be able to create NPCs on the fly for the project I'm working and as far as I know this is the best way to do it, but I can't figure out how to fix this bug.


Does anyone know what the yellow box is or why physics objects only work inside of it and not the regular bounds? It isn't referred to anywhere in the documentation or c++ that I can find.

Is there anyway to rebuild the bounds after I spawn the creature to fix this problem, or better yet a solution that would prevent it from happening in the first place?

Thanks in advance for any help. I'm really stumped by this.

Here is a pic of the issue when I spawn several antLionGuards (this is a stock NPC, and everything else is stock other than the custom NPC I added):