I would like to check to see if two entities are colliding and I am unsure how. I dont care if the two entities are touching, they have to physically be partially inside of eachother.
I tried the method below but it will only work for square objects that aren't at an odd angle.
local pos = self.GhostProp:GetPos()
local min = self.GhostProp:LocalToWorld((self.GhostProp:OBBMins()+Vector(1.5,1.5,1.5)))
local max = self.GhostProp:LocalToWorld((self.GhostProp:OBBMaxs()-Vector(1.5,1.5,1.5)))
for i,v in pairs (ents.FindInBox(min, max)) do
I did look into the physObj:IsPenetrating function but I kept getting this error when trying to use it. "Tried to use invalid object (type IPhysicsObject) (Object was NULL or not of the right type)"
Any ideas on how to check this?