RaycastResult
RaycastResult
Overview
The RaycastResult represents the result of a raycast, which is used to detect intersections between a ray and objects in a 3D space.
Description
A raycast is a way to send out an invisible ray or line from a point in space, commonly used for collision detection, determining hit surfaces, or other spatial queries. The RaycastResult contains detailed information about the intersection or hit, such as the distance, hit position, surface normal, and the instance hit.
Properties
Distance
number
The distance from the origin of the raycast to the detected intersection point.
Code Samples
Instance
Instance
The instance (e.g., a part or model) that the ray hit during the raycast.
Code Samples
Position
Vector3
The position in 3D space where the ray intersects with the object.
Code Samples
Normal
Vector3
The surface normal at the hit point, indicating the direction perpendicular to the surface.
Code Samples
Constructors
Methods
Last updated