Skip to main content

ObjectDetectorHitObject

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


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.


CreatedBy

The UserId of the person who created the part. Parts created by "THE DEVELOPERS" or "???" have a CreatedBy value of -1. It can be nil if the game doesn't know who created the part. It is of the type number. It may also be nil. 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.


LockedBy

The UserId of the person who locked the part. Parts locked by "THE DEVELOPERS" have a LockedBy value of -2 Parts locked by "???" have a LockedBy value of -1 This value will be nil if the part is unlocked. It is of the type number. It may also be nil. It is read-only, it cannot be assigned to.


Name

The name of the hit object. It is of the type string. 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 false. It is read-only, it cannot be assigned to.

Luau Type

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

export type ObjectDetectorHitObject = {
read Color: Color3,
read LockedBy: number?,
read Distance: number,
read Name: string,
read Position: Vector3,
read Size: Vector3,
read isTerrain: false,
read CFrame: CFrame,
read CreatedBy: number?,
}