Hook to detect a physics collision?

I’ve looked around for a while looking for a hook that can report a physics detection between any 2 objects, but I’ve so far been lost, I even tried making a hook from a meta function:


 local meta = FindMetaTable("Entity")

local fcTouch = meta.PhysicsCollide
function meta:PhysicsCollide(...)
	hook.Call("Touch",gmod.GetGamemode(),{self,...})
	return fcTouch(self,...)
end 

Turns out this code did NOT work as PhysicsCollide doesn’t seem to be a working function (even though it is documented?!)

So, I am pretty much lost as to how the hell I am going to find what I need… just for clarification, this is for a Graboid SNPC (from the movie Tremors), if this is of any importance to you which I doubt.

Any pointers?

That’s not how entity hooks work.

You can use http://wiki.garrysmod.com/page/Entity/AddCallback to do what you want.

Ah, thanks, sorry for being a cock and missing the entire callback page…