Skip to main content

ObjectDetectorHitObject

Members

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.


Color

The Color of the hit object. It is of the type Color3.


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.


Distance

The distance between the start of the ray and the contact point. It is of the type number.


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.


Name

The name of the hit object. It is of the type string.


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.


Size

The Size of the hit object. It is of the type Vector3.


isTerrain

Whether or not the hit object is terrain. It is of the type false.

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 = {
Color: Color3,
LockedBy: number?,
Distance: number,
Name: string,
Position: Vector3,
Size: Vector3,
isTerrain: false,
CFrame: CFrame,
CreatedBy: number?,
}