Getting the place where a trace using Util.TraceLine collides with something.
2 replies, posted
I'm trying to find the location where a trace collides with when being drawn with trutil.TraceLine.
I want the trace to start from the player, trace to an object. When it hits the object it gets the location where it collided and it traces up.
[CODE] local tr = {}
tr.start = self:GetPos()
tr.endpos = (self:GetPos() + Vector(-200, 0, 0))
tr.filter = self
trace = util.TraceLine(tr) -- Return result [/CODE]
If say, it collides something at the Vector(-150,0,0), how would I get that location so that I can make it begin the trace up?
[b][url=wiki.garrysmod.com/?title=TraceRes]TraceRes [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] is the wiki page you're looking for.
Oh duh, wasn't thinking when I saw that page. Now I see how to do it.
Thank you, good sir.
Sorry, you need to Log In to post a reply to this thread.