Hello.
Excuse me for any grammatical errors.
I want to make an entity, that no collide with players/props/vehicles.
I saw Collision Enum, but I didn't found anything like this.
There are 2 Collisions that togheter can be good:
COLLISION_GROUP_WORLD | COLLISION_GROUP_WEAPON
How can I set 2 collisions on an Entity?
I think for that you'd need to do [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/SetCustomCollisionCheck]Entity:SetCustomCollisionCheck[/url] and then use a [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/ShouldCollide]GM:ShouldCollide[/url] hook to check if the entity is colliding with a player, prop or vehicle, and if it is, return false
[QUOTE=MPan1;50565913]I think for that you'd need to do [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/SetCustomCollisionCheck]Entity:SetCustomCollisionCheck[/url] and then use a [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/ShouldCollide]GM:ShouldCollide[/url] hook to check if the entity is colliding with a player, prop or vehicle, and if it is, return false[/QUOTE]
Ok, how can I do, if (is a prop) or (is a vehicle) or (is a player)?
[editline]22nd June 2016[/editline]
Ok, I'm using if ent:GetClass() == "prop_"
[editline]22nd June 2016[/editline]
[QUOTE=MPan1;50565913]I think for that you'd need to do [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/SetCustomCollisionCheck]Entity:SetCustomCollisionCheck[/url] and then use a [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/ShouldCollide]GM:ShouldCollide[/url] hook to check if the entity is colliding with a player, prop or vehicle, and if it is, return false[/QUOTE]
hook.Call("ShouldCollide", "SC", function(ent, ent2)
if ent:GetClass() == "prop_" and ent2:GetClass() == "prop_" then return false
end)
It is ok?
[editline]22nd June 2016[/editline]
Anyone?
Sorry, you need to Log In to post a reply to this thread.