How can I check when my trace "leaves" an entity ?
[lua]
local OldHitting = false
hook.Add("Think","TraceCheck",function()
local trace = LocalPlayer():GetEyeTrace()
local hitting = trace.Entity:IsValid()
if hitting == false and OldHitting == true then
print("Stopped hitting the entity!")
end
OldHitting = hitting
end)
[/lua]
Something like that would work, if i understood you correctly.
Thank you. I'm working on some sort of penetration type.
I want to dispatch a trace through an entity and then check if it left the entity or not.
Sorry for not expressing it as clear as I should :P
[url]http://wiki.garrysmod.com/page/Structures/TraceResult[/url]
Look at FractionLeftSolid.
Thanks broski
Sorry, you need to Log In to post a reply to this thread.