[HELP] ShouldCollide check if an entity touch the bounding box, not the vphysics model
0 replies, posted
Hi everyone, if the title wasn't clear, could be for my poor english....Anyway, i'm getting an issue
I'm trying to get if 2 entities is collidings (in this case a player with a prop_physics) but when i put a trace inside the code, the hook is called when the player touch the bounding box...
[img]http://screencloud.net//img/screenshots/834c141be30c1bf9c4cfcbc857727141.png[/img]
And i need to trace when the player is touching the prop, not the bounding box
[b]Code[/b]
[lua]
hook.Add("ShouldCollide","CheckIfColliding",function(ent1,ent2)
if(ent1:IsPlayer() and ent2:GetClass() == "prop_physics") then
ErrorNoHalt("Colliding")
if(ent1:KeyDown(IN_DUCK)) then
ent1:SetLocalVelocity(Vector(0,0,0))
ent1:SetGravity(0.0001)
ent1:SetNWEntity("ATTACHED",ent2)
end
end
return true
end)
[/lua]
Thanks so much for see my post
Sorry, you need to Log In to post a reply to this thread.