RaycastResult

Overview

RaycastResult is a data type that contains result information about what target a raycast actually collided with. It is returned when a WorldRoot:Raycast call succeeds and provides various data needed for raycast result analysis, such as collision point, collided object, and surface information.

Constructors

Properties

BlockingHit

boolean

Indicates whether the raycast hit a blocking object.

Code Samples

Distance

number

Represents the straight-line distance from where the Raycast started to where the collision occurred.

Code Samples

Instance

Instance

Represents the target object the Raycast collided with.

Code Samples

Normal

Vector3

A vector representing the direction the surface that the Raycast collided with is facing. It is based on the direction perpendicular to the plane at the collision point, and used in subsequent operations such as reflection processing, angle calculation, and surface direction detection.

Code Samples

Position

Vector3

Represents the position where the Raycast collided with the target as coordinates in world space.

Code Samples

Methods

Events

See also

WorldRoot

Last updated