When two props (namely prop_vehicle_jeep, untested with others) collide repeatedly, one is automatically sent to COLLISION_GROUP_NONE, and they phase through eachother.
[LUA]
function GM:ShouldCollide(ent1, ent2)
return true
end
– Or
function GM:ShouldCollide(ent1, ent2)
if ent1:GetClass() == “prop_vehicle_jeep” and ent2:GetClass() == “prop_vehicle_jeep” then
ent1:SetCollisionGroup(COLLISION_GROUP_VEHICLE)
ent2:SetCollisionGroup(COLLISION_GROUP_VEHICLE)
end
return true
end
[/LUA]
Neither of the above has any effect. I also tried hooking instead of overriding, for what it’s worth. If I don’t change the collision group, and I print it in ShouldCollide, ent2’s changes to 1 (COLLISION_GROUP_NONE). If I change the collision group (even if it’s AFTER my print!) then printing always shows both collision groups as 7 (COLLISION_GROUP_VEHICLE), but the two still don’t collide.
After the FIRST time it runs on that entity, the collision group forever prints as 7 (because I set it to that). It never goes back to 1, but the entities still phase through eachother. So it’s not being reset to 1 each time (because I print BEFORE I change it in ShouldCollide), but that seems to be irrelevant.
Any tips?