Traces - S&box Wiki

https://wiki.facepunch.com/sbox/Traces

S&box Wiki Home / Traces View Edit History Title Tag (Traces) Traces are imaginary lines. When you run a Trace you get a TraceResult - which tells you what the line hit. So for example, if you, as the player, wanted to spawn a box. You'd run a Trace from the player's eyeball to 200 units in the direction that the player is looking. The TraceResult would show that it hit a point and now you know where to place the box. Traces are constructed using the Trace static functions, and configured using members. You run the trace and get the result using Run(). var mytrace = Trace . Ray ( startPos, endPos ); mytrace = mytrace . WorldOnly (); var result = mytrace . Run (); The configuration functions return a new object. This is a convenience thing, so you can format like this: var tr = Trace . Ray ( startPos, endPos ). Run (); or like this var tr = Trace . ...

Linked on 2023-03-20 09:02:18 | Similar Links