The GameObject
field in the SceneTraceResult
struct represents the GameObject
that was hit during a scene trace operation. This field is read-only and provides information about the specific game object that was intersected by the trace.
The GameObject
field in the SceneTraceResult
struct represents the GameObject
that was hit during a scene trace operation. This field is read-only and provides information about the specific game object that was intersected by the trace.
Use the GameObject
field to access the game object that was hit by a trace. This can be useful for determining which object in the scene was intersected and for performing further operations or logic based on that object.
// Example of using SceneTraceResult to get the GameObject hit SceneTraceResult traceResult = Scene.Trace(...); if (traceResult.Hit) { GameObject hitObject = traceResult.GameObject; // Perform operations with the hit GameObject // For example, logging the name of the hit object string objectName = hitObject.Name; // Use objectName or other properties of hitObject as needed }