Skip to main content
Version: latest - a1.65.x โš–๏ธ

๐Ÿ” Trace

Trace a ray against the world and get collided objects information.

๐Ÿ—ฟStatic Class
This is a Static Class. Access it's methods directly with .. It's not possible to spawn new instances.
๐Ÿ’‚Authority
This static class can be accessed only on ๐ŸŸง Client side.
๐Ÿง‘โ€๐Ÿ’ปAPI Source
This page is auto-generated! The Functions, Properties and Events described here are defined in our GitHub's API Repository! Feel free to commit suggestions and changes to the source .json API files!

๐Ÿ—ฟย Static Functionsโ€‹

ReturnsNameDescription
table of tableBoxMultiTrace a box against the world using object types and return overlapping hits and then first blocking hit
tableBoxSingleTrace a box against the world and returns a table with the first blocking hit information
table of tableCapsuleMultiTrace a capsule against the world using object types and return overlapping hits and then first blocking hit
tableCapsuleSingleTrace a capsule against the world and returns a table with the first blocking hit information
table of tableLineMultiTrace a ray against the world using object types and return overlapping hits and then first blocking hit
tableLineSingleTrace a ray against the world and returns a table with the first blocking hit information
table of tableSphereMultiTrace a sphere against the world using object types and return overlapping hits and then first blocking hit
tableSphereSingleTrace a sphere against the world and returns a table with the first blocking hit information

BoxMulti

Trace a box against the world using object types and return overlapping hits and then first blocking hit

Note: The Trace will collide with the ObjectType (in the Collision Settings), even if the channel is ignored below.

Results are sorted, so a blocking hit (if found) will be the last element of the array

Only the single closest blocking result will be generated, no tests will be done after that

โ€” Returns table of table (with this format).

local ret = Trace.BoxMulti(start_location, end_location, half_size, orientation, collision_channel?, trace_mode?, ignored_actors?)
TypeParameterDefaultDescription
Vectorstart_location Required parameter Start location of the box
Vectorend_location Required parameter End location of the box
Vectorhalf_size Required parameter Distance from the center of box along each axis
Rotatororientation Required parameter Orientation of the box
CollisionChannelcollision_channel?WorldStaticSupports several channels separating by | (using bit-wise operations)
TraceModetrace_mode?0Trace Mode, pass all parameters separating by | (using bit-wise operations)

You need to explicitily pass the modes to return the values you want
table of Base Actorignored_actors?{}Array of actors to ignore during the trace

BoxSingle

Trace a box against the world and returns a table with the first blocking hit information

Note: The Trace will collide with the ObjectType (in the Collision Settings), even if the channel is ignored below.

โ€” Returns table (with this format).

local ret = Trace.BoxSingle(start_location, end_location, half_size, orientation, collision_channel?, trace_mode?, ignored_actors?)
TypeParameterDefaultDescription
Vectorstart_location Required parameter Start location of the box
Vectorend_location Required parameter End location of the box
Vectorhalf_size Required parameter Distance from the center of box along each axis
Rotatororientation Required parameter Orientation of the box
CollisionChannelcollision_channel?WorldStaticSupports several channels separating by | (using bit-wise operations)
TraceModetrace_mode?0Trace Mode, pass all parameters separating by | (using bit-wise operations)

You need to explicitily pass the modes to return the values you want
table of Base Actorignored_actors?{}Array of actors to ignore during the trace

CapsuleMulti

Trace a capsule against the world using object types and return overlapping hits and then first blocking hit

Note: The Trace will collide with the ObjectType (in the Collision Settings), even if the channel is ignored below.

Results are sorted, so a blocking hit (if found) will be the last element of the array

Only the single closest blocking result will be generated, no tests will be done after that

โ€” Returns table of table (with this format).

local ret = Trace.CapsuleMulti(start_location, end_location, radius, half_height, collision_channel?, trace_mode?, ignored_actors?)
TypeParameterDefaultDescription
Vectorstart_location Required parameter Start location of the capsule
Vectorend_location Required parameter End location of the capsule
floatradius Required parameter Radius of the capsule to sweep
floathalf_height Required parameter Distance from center of capsule to tip of hemisphere endcap.
CollisionChannelcollision_channel?WorldStaticSupports several channels separating by | (using bit-wise operations)
TraceModetrace_mode?0Trace Mode, pass all parameters separating by | (using bit-wise operations)

You need to explicitily pass the modes to return the values you want
table of Base Actorignored_actors?{}Array of actors to ignore during the trace

CapsuleSingle

Trace a capsule against the world and returns a table with the first blocking hit information

Note: The Trace will collide with the ObjectType (in the Collision Settings), even if the channel is ignored below.

โ€” Returns table (with this format).

local ret = Trace.CapsuleSingle(start_location, end_location, radius, half_height, collision_channel?, trace_mode?, ignored_actors?)
TypeParameterDefaultDescription
Vectorstart_location Required parameter Start location of the capsule
Vectorend_location Required parameter End location of the capsule
floatradius Required parameter Radius of the capsule to sweep
floathalf_height Required parameter Distance from center of capsule to tip of hemisphere endcap.
CollisionChannelcollision_channel?WorldStaticSupports several channels separating by | (using bit-wise operations)
TraceModetrace_mode?0Trace Mode, pass all parameters separating by | (using bit-wise operations)

You need to explicitily pass the modes to return the values you want
table of Base Actorignored_actors?{}Array of actors to ignore during the trace

LineMulti

Trace a ray against the world using object types and return overlapping hits and then first blocking hit

Note: The Trace will collide with the ObjectType (in the Collision Settings), even if the channel is ignored below.

Results are sorted, so a blocking hit (if found) will be the last element of the array

Only the single closest blocking result will be generated, no tests will be done after that

โ€” Returns table of table (with this format).

local ret = Trace.LineMulti(start_location, end_location, collision_channel?, trace_mode?, ignored_actors?)
TypeParameterDefaultDescription
Vectorstart_location Required parameter Start location of the ray
Vectorend_location Required parameter End location of the ray
CollisionChannelcollision_channel?WorldStaticSupports several channels separating by | (using bit-wise operations)
TraceModetrace_mode?0Trace Mode, pass all parameters separating by | (using bit-wise operations)

You need to explicitily pass the modes to return the values you want
table of Base Actorignored_actors?{}Array of actors to ignore during the trace

LineSingle

Trace a ray against the world and returns a table with the first blocking hit information

Note: The Trace will collide with the ObjectType (in the Collision Settings), even if the channel is ignored below.

โ€” Returns table (with this format).

local ret = Trace.LineSingle(start_location, end_location, collision_channel?, trace_mode?, ignored_actors?)
TypeParameterDefaultDescription
Vectorstart_location Required parameter Start location of the ray
Vectorend_location Required parameter End location of the ray
CollisionChannelcollision_channel?WorldStaticSupports several channels separating by | (using bit-wise operations)
TraceModetrace_mode?0Trace Mode, pass all parameters separating by | (using bit-wise operations)

You need to explicitily pass the modes to return the values you want
table of Base Actorignored_actors?{}Array of actors to ignore during the trace

SphereMulti

Trace a sphere against the world using object types and return overlapping hits and then first blocking hit

Note: The Trace will collide with the ObjectType (in the Collision Settings), even if the channel is ignored below.

Results are sorted, so a blocking hit (if found) will be the last element of the array

Only the single closest blocking result will be generated, no tests will be done after that

โ€” Returns table of table (with this format).

local ret = Trace.SphereMulti(start_location, end_location, radius, collision_channel?, trace_mode?, ignored_actors?)
TypeParameterDefaultDescription
Vectorstart_location Required parameter Start location of the sphere
Vectorend_location Required parameter End location of the sphere
floatradius Required parameter Radius of the sphere
CollisionChannelcollision_channel?WorldStaticSupports several channels separating by | (using bit-wise operations)
TraceModetrace_mode?0Trace Mode, pass all parameters separating by | (using bit-wise operations)

You need to explicitily pass the modes to return the values you want
table of Base Actorignored_actors?{}Array of actors to ignore during the trace

SphereSingle

Trace a sphere against the world and returns a table with the first blocking hit information

Note: The Trace will collide with the ObjectType (in the Collision Settings), even if the channel is ignored below.

โ€” Returns table (with this format).

local ret = Trace.SphereSingle(start_location, end_location, radius, collision_channel?, trace_mode?, ignored_actors?)
TypeParameterDefaultDescription
Vectorstart_location Required parameter Start location of the sphere
Vectorend_location Required parameter End location of the sphere
floatradius Required parameter Radius of the sphere
CollisionChannelcollision_channel?WorldStaticSupports several channels separating by | (using bit-wise operations)
TraceModetrace_mode?0Trace Mode, pass all parameters separating by | (using bit-wise operations)

You need to explicitily pass the modes to return the values you want
table of Base Actorignored_actors?{}Array of actors to ignore during the trace

๐Ÿš€ย Eventsโ€‹

This class doesn't have own events.