Skip to main content

ObjectDetectorHitTerrain

The data provided by the object detector when it hits terrain.


CFrame

The CFrame of the hit object. It is of the type CFrame. It is read-only, it cannot be assigned to.


Color

The Color of the hit object. It is of the type Color3. It is read-only, it cannot be assigned to.


Distance

The distance between the start of the ray and the contact point. It is of the type number. It is read-only, it cannot be assigned to.


Name

The name of the hit object. If it is "Collider" then the object detector is hitting an EnergyShield, it can also be a player's limb, it will not provide the name of the player, just the name of the hit limb. It can be any string, some example possibilities include: "Head", "Torso", "Left Arm", "Right Arm", "Left Leg", "Right Leg", "Collider". It is read-only, it cannot be assigned to.


Position

The Position of the hit object itself, not the Position of contact between the ray and the object. It is of the type Vector3. It is read-only, it cannot be assigned to.


Size

The Size of the hit object. It is of the type Vector3. It is read-only, it cannot be assigned to.


isTerrain

Whether or not the hit object is terrain. It is of the type true. It is read-only, it cannot be assigned to.

Luau Type

This is the luau type for ObjectDetectorHitTerrain. It may help clear up mistranslations from the raw data to the wiki page (as it is an automatic process).

export type ObjectDetectorHitTerrain = {
read Distance: number,
read Name: "Head" | "Torso" | "Left Arm" | "Right Arm" | "Left Leg" | "Right Leg" | "Collider" | string,
read Position: Vector3,
read Color: Color3,
read isTerrain: true,
read CFrame: CFrame,
read Size: Vector3,
}