• Trace
    2 replies, posted
[quote]local pos = self.Owner:GetShootPos() local ang = self.Owner:GetAimVector() local tracedata = {} tracedata.start = pos tracedata.endpos = pos+(ang*80) tracedata.filter = self.Owner local trace = util.TraceLine(tracedata) if trace.HitNonWorld then target = trace.Entity --make it splode or something end[/quote] Hey, I've got a problem with understanding of this piece of code. Can someone tell me what self.Owner does and when we use it? Also, what is with this tracedata.endpos = pos+(ang*80)? And how can we check if trace hit the player?
self.Owner is the owner of the entity ( I think ) or else its the player. tracedata.endpos = pos+(ang*80) is basicly, the Position + The Angle timed with 80, Which gives an Angle of 80. Because Angle = 1.
Sorry, you need to Log In to post a reply to this thread.