As the topic title states, I’m trying to get two separate instances of the same entity to not collide.
My current code, in lua\autorun\collisions.lua:
hook.Add("ShouldCollide", "ShouldCollideKnivesHook", function(ent1, ent2) -- If both entities are knives, but they have different owners, don't collide. if (ent1:GetClass() == "sent_proj_sakuyaKnife01" && ent2:GetClass() == "sent_proj_sakuyaKnife01") then --if (ent1.Owner != ent2.Owner) --then return false --end end end )
Now, I’ve tried placing this code in an autorun file (as shown above), as well as trying it in the shared.lua and init.lua of the actual entity. But, for some reason, the instances still collide with each other. I’ve been going at this problem for half the day now, and I just can’t figure out what the cause is.
Any help would be greatly appreciated.