• Doing a trace directly upwards from an entity
    8 replies, posted
I need to do a trace to detect if an entity is outdoors. How!?
[lua]util.QuickTrace(ent:GetPos(), Vector(0, 0, 1), ent)[/lua]
[QUOTE=MakeR;16997457][lua]util.QuickTrace(ent:GetPos(), Vector(0, 0, 1), ent)[/lua][/QUOTE] Not really, try this : [lua]util.QuickTrace(ent:GetPos(),ent:LocalToWorld(Vector(0,0,1)), ent)[/lua]
[QUOTE=kevkev;16998691]Not really, try this : [lua]util.QuickTrace(ent:GetPos(),ent:LocalToWorld(Vector(0,0,1)), ent)[/lua][/QUOTE] Why would you need to do that? [editline]11:59AM[/editline] The second argument is the direction, up would be Vector(0, 0, 1).
Since if the object's position was Vector(0,0,4) it would make a trace downwards, my code makes it go Vector(0,0,1) higher than the entitie's current pos. [editline]01:00PM[/editline] I guess i also could have done ent:GetPos()+Vector(0,0,1)
No it wouldn't, the second argument is the direction of the trace, not the where it should hit.
Shit, probably got confused with until.TraceLine() then.
Probably.
Thanks guys, but I figured out a better way, instead of needing an entity and a swep I've just got a swep.
Sorry, you need to Log In to post a reply to this thread.