functions Methods 30

Body (body, to)
SceneTrace
Casts a PhysicsBody from its current position and rotation to desired end point.
Box (extents, from, to)
SceneTrace
Casts a box from point A to point B.
Capsule (capsule)
SceneTrace
Casts a capsule
Cone (height, baseRadius)
SceneTrace
Casts a cone (base at bottom, apex at top).
Cylinder (height, radius)
SceneTrace
Casts a cylinder
FromTo (from, to)
SceneTrace
Sets the start and end positions of the trace request
HitTriggers ()
SceneTrace
Hit Triggers
HitTriggersOnly ()
SceneTrace
Hit Only Triggers
IgnoreDynamic ()
SceneTrace
Do not hit dynamic objects
IgnoreGameObject (obj)
SceneTrace
Do not hit this object
IgnoreGameObjectHierarchy (obj)
SceneTrace
Do not hit this object
IgnoreKeyframed ()
SceneTrace
Do not hit keyframed objects
IgnoreStatic ()
SceneTrace
Do not hit static objects
Radius (radius)
SceneTrace
Makes this trace a sphere of given radius.
Ray (from, to)
SceneTrace
Casts a ray from point A to point B.
Rotated (rotation)
SceneTrace
Makes this a rotated trace, for tracing rotated boxes and capsules.
Run ()
SceneTraceResult
Run the trace and return the result. The result will return the first hit.
RunAll ()
IEnumerable`1
Run the trace and record everything we hit along the way. The result will be an array of hits.
Size (hull)
SceneTrace
Makes this trace an axis aligned box of given size. Extracts mins and maxs from the Bounding Box.
Sphere (radius, from, to)
SceneTrace
Casts a sphere from point A to point B.
Sweep (body, from, to)
SceneTrace
Sweeps each PhysicsShape of given PhysicsBody and returns the closest collision. Does not support Mesh PhysicsShapes. Basically 'hull traces' but with physics shapes. Same as tracing a body but allows rotation to change during the sweep.
UseHitboxes (hit)
SceneTrace
Should we hit hitboxes
UseHitPosition (enabled)
SceneTrace
Should we compute hit position.
UsePhysicsWorld (hit)
SceneTrace
Should we hit physics objects?
UseRenderMeshes (hit)
SceneTrace
Should we hit meshes too? This can be slow and only works for the editor.
WithAllTags (tags)
SceneTrace
Only return entities with all of these tags
WithAnyTags (tags)
SceneTrace
Only return entities with any of these tags
WithCollisionRules (tag, asTrigger)
SceneTrace
Use the collision rules of an object with the given tags.
WithoutTags (tags)
SceneTrace
Only return entities without any of these tags
WithTag (tag)
SceneTrace
Only return entities with this tag. Subsequent calls to this will add multiple requirements and they'll all have to be met (ie, the entity will need all tags).
trophy 4058
Sep 2022 69 posts
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.
trophy 115
Mar 2026 4 posts
    private void ShootRayFromEyesAndInteract(
        PlayerController playerController,
        float InteractDistance
    )
    {
        var ray = playerController.EyeTransform.ForwardRay;
        var trace = Scene
            .Trace.Ray(in ray, InteractDistance)
            .IgnoreGameObjectHierarchy(playerController.GameObject)
            .Run();

        if (!trace.Hit)
            return;

        IIntractable component = trace.GameObject.GetComponent<IIntractable>();

        if (component == null)
            return;

        component.DoAction();
    }
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.