• Large NPC hitbox issues
    9 replies, posted
I am trying to create a large npc that has a proper collision box, I have setup a model with the correct size and the model's collision box is the correct size. When I pickup the NPC with the phys gun the npc is properly highlighted, but when I attempt to shoot a rocket at the NPC the rocket's entity doesn't collide with the NPC. The NPC cannot be shot either.
Did you use [URL="http://wiki.garrysmod.com/page/Entity/SetCollisionBounds"]SetCollisionBounds?[/URL]
[QUOTE=Angry pepper;46502924]Did you use [URL="http://wiki.garrysmod.com/page/Entity/SetCollisionBounds"]SetCollisionBounds?[/URL][/QUOTE] Yes, then the entity can collide with players and the world. I set the collision group to COLLISION_GROUP_NONE and it still didn't help. The phys gun can only pickup the entity if I hover over the giant npc's feet. The bounding box doesn't want to follow the collision box or vice versa. Any Ideas?
My SNPC base has this: [CODE]self:SetCollisionBounds(Vector(-self.m_vcCollisionBounds[1],-self.m_vcCollisionBounds[2],-self.m_vcCollisionBounds[3]),Vector(self.m_vcCollisionBounds[1],self.m_vcCollisionBounds[2],self.m_vcCollisionBounds[3])) self:SetHullType(self.m_iHull) self:SetHullSizeNormal() self:SetCollisionGroup(COLLISION_GROUP_NPC) self:SetSolid(SOLID_BBOX) [/CODE] Physics works flawlessly.
[QUOTE=Angry pepper;46505359]My SNPC base has this: [CODE]self:SetCollisionBounds(Vector(-self.m_vcCollisionBounds[1],-self.m_vcCollisionBounds[2],-self.m_vcCollisionBounds[3]),Vector(self.m_vcCollisionBounds[1],self.m_vcCollisionBounds[2],self.m_vcCollisionBounds[3])) self:SetHullType(self.m_iHull) self:SetHullSizeNormal() self:SetCollisionGroup(COLLISION_GROUP_NPC) self:SetSolid(SOLID_BBOX) [/CODE] Physics works flawlessly.[/QUOTE] Could I take a look at your SNPC base?
[QUOTE=BrownZFilmZ;46505527]Could I take a look at your SNPC base?[/QUOTE] [URL="http://pastebin.com/PGt01fxK"]There's nothing much else that I think should be important, but here it is.[/URL]
[QUOTE=Angry pepper;46505543][URL="http://pastebin.com/PGt01fxK"]There's nothing much else that I think should be important, but here it is.[/URL][/QUOTE] Thanks, I'll take a look and let you know how it goes. Trying to make a Titan NPC for Attack On Titan.
[QUOTE=Angry pepper;46505543][URL="http://pastebin.com/PGt01fxK"]There's nothing much else that I think should be important, but here it is.[/URL][/QUOTE] Props don't seem to collide with the npc though.
[QUOTE=BrownZFilmZ;46506886]Props don't seem to collide with the npc though.[/QUOTE] How peculiar... By this point, I'm literally out of ideas as to what could be causing this.
[QUOTE=Angry pepper;46506986]How peculiar... By this point, I'm literally out of ideas as to what could be causing this.[/QUOTE] Yep, it's wierd. The rpg entity collides, the bullets hit... physgun works fine... player collides, but props don't collide. Edit: Is there a way to get the collision box to be based on the model, that way I can walk under the giant's legs.
Sorry, you need to Log In to post a reply to this thread.