• Entity that doesn't collide but can be shot
    6 replies, posted
I have a custom entity that I'd like players to be able to pass through (no collide), but still be able to shoot so the OnTakeDamage() method is still called. If using the following the entity can be shot, but still is solid [code] self:SetSolid( SOLID_VPHYSICS ) [/code] If using SOLID_NONE then it can't be shot and you can walk through it [code] self:SetSolid( SOLID_NONE )[/code] If there one that offers one but not the other?
From the GMod wiki [QUOTE]SHARED | 0000000000000000 | 00000000000000000 | SOLID_NONE SHARED | 0000000000000001 | 00000000000000001 | SOLID_BSP SHARED | 0000000000000002 | 00000000000000010 | SOLID_BBOX SHARED | 0000000000000003 | 00000000000000011 | SOLID_OBB SHARED | 0000000000000004 | 00000000000000100 | SOLID_OBB_YAW SHARED | 0000000000000005 | 00000000000000101 | SOLID_CUSTOM SHARED | 0000000000000006 | 00000000000000110 | SOLID_VPHYSICS[/QUOTE] Test these out and see what they do.
If I understand you right, you want [URL=http://wiki.garrysmod.com/page/Entity/SetCollisionGroup]entity:SetCollisionGroup( 11 )[/URL]
That's exactly the function I'm looking for, thank you. I think I want COLLISION_GROUP_PROJECTILE or COLLISION_GROUP_WEAPON. Will try these out and let you know.
I use COLLISION_GROUP_DEBRIS_TRIGGER so that it won't collide with anything but the world, can be triggered and can be shot. This prevents weapons and props from lagging the heck out of the server while they're on top of each other, etc. Also: [QUOTE=rejax;41809277]If I understand you right, you want [URL=http://wiki.garrysmod.com/page/Entity/SetCollisionGroup]entity:SetCollisionGroup( 11 )[/URL][/QUOTE] Don't use numbers, use the ENUM name.
[QUOTE=Pegpro;41811428]That's exactly the function I'm looking for, thank you. I think I want COLLISION_GROUP_PROJECTILE or COLLISION_GROUP_WEAPON. Will try these out and let you know.[/QUOTE] Just a heads up for anyone that comes across this: COLLISION_GROUP_WEAPON isn't what you might think. Its purpose is to make [b]weapons[/b] not collide with things.
I agree COLLISION_GROUP_DEBRIS_TRIGGER does exactly what I am looking for, some of the names are a little misleading, it would be great if we could add more detail to the wiki page.
Sorry, you need to Log In to post a reply to this thread.