Instance which facilitates and encourages interaction with 3D objects in an experience.
- Memory category
- Instances
- Own members
- 43
- Inherited members
- 84
- Subclasses
- 0
- Siblings
- 1
Properties57
Property categoryBehavior
- Determines if an
Instanceand its descendants can be cloned usingInstance:Clone(), and can be saved/published. - Deprecated: This deprecated property is a variant of
Instance.Archivablewhich should be used instead.Use Archivable instead.
Property categoryData
Property categoryPermissions
- The set of capabilities allowed to be used for scripts inside this container.
- Indicates whether the instance is inside a sandboxed container.
- When enabled, the instance can only access abilities in its
Capabilitieslist.
Property categoryData
- Maximum distance between a character and the
ClickDetectororDragDetectorfor the player to be able to interact with it.
Property categoryImage
ClickDetector.CursorIcon: string = "" Sets the cursor icon to display when the mouse is hovered over the parent of thisClickDetectororDragDetector.- Sets the cursor icon to display when the mouse is hovered over the parent of this
ClickDetectororDragDetector. Only supports asset URIs.
Defined byDragDetector31
Property categoryBehavior
DragDetector.DragStyle: Enum.DragDetectorDragStyle = Enum.DragDetectorDragStyle.TranslatePlane The paradigm used to generate proposed motion.DragDetector.Enabled: boolean = true Whether theDragDetectorresponds to user input.DragDetector.PermissionPolicy: Enum.DragDetectorPermissionPolicy = Enum.DragDetectorPermissionPolicy.Everybody Controls the permission level for which players can interact with theDragDetector.DragDetector.ResponseStyle: Enum.DragDetectorResponseStyle = Enum.DragDetectorResponseStyle.Physical The paradigm used to move, or not move, the objects affected by the drag detector.DragDetector.RunLocally: boolean = false Whether user input on aDragDetectorreplicates to the server or remains local to the specific client.DragDetector.TrackballRadialPullFactor: number = 1 IfDragStyleisDragDetectorDragStyle.RotateTrackball, multiplier for adding a radial pull rotation as a contribution to the total.DragDetector.TrackballRollFactor: number = 1 IfDragStyleisDragDetectorDragStyle.RotateTrackball, multiplier for adding roll rotation to the total.
Property categoryData
Property categoryDrag Directions
- The primary axis of motion, expressed relative to the reference frame.
- Specifies the YXZ rotation of axes of motion relative to the reference frame.
- The secondary axis of the motion.
- The
Axisexpressed in world space. - The
SecondaryAxisexpressed in world space.
Property categoryDrag Limits
DragDetector.MaxDragAngle: number = 0 Along withMinDragAngle, impedes the drag detector's attempts to generate motion.- Along with
MinDragTranslation, impedes the drag detector's attempts to generate motion. DragDetector.MinDragAngle: number = 0 Along withMaxDragAngle, impedes the drag detector's attempts to generate motion.- Along with
MaxDragTranslation, impedes the drag detector's attempts to generate motion.
Property categoryDragged Amount
- The
CFrameof the pivot, dependent on the drag detector'sReferenceInstance.
Property categoryImage
DragDetector.ActivatedCursorIcon: string = "" Sets the cursor icon to display when the mouse is activated over the parent of thisDragDetector.DragDetector.ActivatedCursorIconContent: Content Sets the cursor icon to display when the mouse is activated over the parent of thisDragDetector. Only supports asset URIs
Property categoryInternal
Property categoryMode Switching
DragDetector.GamepadModeSwitchKeyCode: Enum.KeyCode = Enum.KeyCode.ButtonR1 During gamepad input, the modifierKeyCodefor the secondary mode of motion.DragDetector.KeyboardModeSwitchKeyCode: Enum.KeyCode = Enum.KeyCode.LeftControl During keyboard input, the modifierKeyCodefor the secondary mode of motion.DragDetector.VRSwitchKeyCode: Enum.KeyCode = Enum.KeyCode.ButtonL2 During VR input, the modifierKeyCodefor the secondary mode of motion.
Property categoryPhysics Response
DragDetector.ApplyAtCenterOfMass: boolean = false Whether constraint force is applied to the object's center of mass.DragDetector.MaxForce: number = 10000000 Maximum force applied for the object to reach its goal.DragDetector.MaxTorque: number = 10000 Maximum torque applied for the object to reach its goal.DragDetector.Responsiveness: number = 10 Higher values cause the object to reach its goal more rapidly.
No properties match the filters.
Methods47
Object:GetPropertyChangedSignal( property: string): RBXScriptSignal Get an event that fires when a given property of the object changes.Parameters Parameter Description property: stringThe property to connect to.Returns Type Description RBXScriptSignalA signal that fires whenever the property changes.- Returns true if an object's class matches or inherits from a given class.
Parameters Parameter Description className: stringThe class against which the Object's class will be checked. Case-sensitive.Returns Type Description booleanDescribes whether the Object's class matched or is a subclass of the given class. - Deprecated: This deprecated function is a variant of
Object:IsA()which should be used instead.Parameters Parameter className: stringReturns Type booleanUse IsA instead.
- Applies a tag to the instance.
Parameters Parameter Description tag: stringThe tag to apply to the instance. - This method destroys all of an instance's children.
- Create a copy of an instance and all its descendants, ignoring instances that are not
Archivable.Returns Type Description InstanceA copy of the instance, ornilif the instance is notArchivable. - Sets the
Instance.Parentproperty tonil, locks theInstance.Parentproperty, disconnects all connections, and callsDestroy()on all children. Instance:FindFirstAncestor( name: string): Instance Returns the first ancestor of theInstancewhoseInstance.Nameis equal to the given name.Parameters Parameter Description name: stringTheInstance.Nameto be looked for.Instance:FindFirstAncestorOfClass( className: string): Instance Returns the first ancestor of theInstancewhoseObject.ClassNameis equal to the given className.Parameters Parameter Description className: stringTheObject.ClassNameto be looked for.Instance:FindFirstAncestorWhichIsA( className: string): Instance Returns the first ancestor of theInstancefor whomObject:IsA()returns true for the given className.Parameters Parameter Description className: stringTheObject.ClassNameto be looked for.Instance:FindFirstChild( name: string, recursive: boolean? = false): Instance Returns the first child of theInstancefound with the given name.Parameters Parameter Description name: stringTheInstance.Nameto be searched for.recursive: boolean? = falseWhether or not the search should be conducted recursively.Instance:FindFirstChildOfClass( className: string): Instance Parameters Parameter Description className: stringTheObject.ClassNameto be looked for.Instance:FindFirstChildWhichIsA(className: string,recursive: boolean? = false,): Instance Returns the first child of theInstancefor whomObject:IsA()returns true for the given className.Parameters Parameter Description className: stringTheObject.ClassNameto be searched for.recursive: boolean? = falseWhether or not the search should be conducted recursively.Instance:FindFirstDescendant( name: string): Instance Returns the first descendant found with the givenInstance.Name.Parameters Parameter Description name: stringTheInstance.Nameto search for.- Returns the
Actorassociated with the Instance, if any. Instance:GetAttribute( attribute: string): any Returns the value which has been assigned to the given attribute name.Parameters Parameter Description attribute: stringThe name of the attribute being retrieved.Returns Type Description anyThe value which has been assigned to the given attribute name. If no attribute has been assigned,nilis returned.Instance:GetAttributeChangedSignal( attribute: string): RBXScriptSignal Returns an event that fires when the given attribute changes.Parameters Parameter Description attribute: stringThe name of the specified attribute for which the change signal is being returned.Returns Type Description RBXScriptSignalAn event that fires when the given attribute changes.- Returns a dictionary of the instance's attributes.
Returns Type Description { [string]: any }A dictionary of string → variant pairs for each attribute where the string is the name of the attribute and the variant is a non-nil value. - Returns an array containing all of the instance's children.
Returns Type Description { Instance }An array containing the instance's children. Instance:GetDebugId( scopeLength: number? = 4): string Returns a coded string of the debug ID used internally by Roblox.Parameters Parameter Description scopeLength: number? = 4The scope length.Returns Type Description stringThe Debug ID string.- Returns an array containing all of the descendants of the instance.
Returns Type Description { Instance }An array containing the instance's descendants. - Returns a string describing the instance's ancestry.
- Returns the styled or explicitly modified value of the specified property, or else the default property value if it hasn't been styled/modified.
Parameters Parameter Description name: stringName of the property to query.selector: string?Optional selector for the pseudo instance you are targeting on the instance.Returns Type Description anyThe styled or explicitly modified value of the specified property, or else the default property value if it hasn't been styled/modified. Instance:GetStyledPropertyChangedSignal( property: string): RBXScriptSignal Returns an event that fires when the given style property changes on the instance.Parameters Parameter Description property: stringName of the style property for which to listen for changes.Returns Type Description RBXScriptSignalEvent that fires when the given style property changes.- Gets an array of all tags applied to the instance.
Returns Type Description { any }An array of strings, each representing a tag applied to the instance. - Check whether the instance has a given tag.
Parameters Parameter Description tag: stringThe tag to check for on the instance.Returns Type Description booleantrueif the instance has the given tag,falseotherwise. Instance:IsAncestorOf( descendant: Instance): boolean Returns true if anInstanceis an ancestor of the given descendant.Instance:IsDescendantOf( ancestor: Instance): boolean Returnstrueif anInstanceis a descendant of the given ancestor.Instance:IsPropertyModified( property: string): boolean Returnstrueif the value stored in the specified property is not equal to the code-instantiated default.Parameters Parameter Description property: stringName of the property to query.Returns Type Description booleanBoolean indicating whether the property is modified from its code‑instantiated default.Instance:QueryDescendants( selector: string): { Instance } Returns an array containing all descendants of the instance that match theselectorstring.Parameters Parameter Description selector: stringSelector string used to filter elements.Returns Type Description { Instance }An array of instances (empty if nothing matched the selector).- Removes a tag from the instance.
Parameters Parameter Description tag: stringThe tag to remove from the instance. Instance:ResetPropertyToDefault( property: string) Resets a property to its default value.Parameters Parameter Description property: stringName of the property to reset.Instance:SetAttribute( attribute: string, value: any) Sets the attribute with the given name to the given value.Instance:WaitForChild( childName: string, timeOut: number): Instance Returns the child of theInstancewith the given name. If the child does not exist, it will yield the current thread until it does.Parameters Parameter Description childName: stringTheInstance.Nameto be looked for.timeOut: numberAn optional time out parameter.- Deprecated: This item is deprecated in favor of
Instance:Destroy()andInstance:ClearAllChildren(). If you must remove an object from the game, and wish to use the object later, set itsParentproperty tonilinstead of using this method.
Sets the object'sParenttonil, and does the same for all its descendants. - Deprecated: This item has been superseded by
Instance:GetChildren()which should be used in all new work.
Returns an array of the object's children.Returns Type Description { Instance }Array of child objects/instances.Use GetChildren instead.
- Deprecated: This deprecated function is a variant of
Instance:Clone()which should be used instead.Returns Type InstanceUse Clone instead.
- Deprecated: This deprecated function is a variant of
Instance:Destroy()which should be used instead.Use Destroy instead.
Instance:findFirstChild( name: string, recursive: boolean? = false): Instance Deprecated: This deprecated function is a variant ofInstance:FindFirstChild()which should be used instead.Returns Type InstanceUse FindFirstChild instead.
- Deprecated: This deprecated function is a variant of
Instance:GetChildren()which should be used instead.Returns Type { Instance }Use GetChildren instead.
Instance:isDescendantOf( ancestor: Instance): boolean Deprecated: This deprecated function is a variant ofInstance:IsDescendantOf()which should be used instead.Parameters Parameter ancestor: InstanceReturns Type booleanUse IsDescendantOf instead.
- Deprecated: This deprecated function is a variant of
Instance:Remove()which has also been deprecated. Neither function should be used in new work.Use Remove instead.
Defined byDragDetector5
DragDetector:AddConstraintFunction(priority: number,function: (...any) -> ...any,): RBXScriptConnection Adds a function to modify or constrain proposed motion.Parameters Parameter Description priority: numberThe order of priority for functions added via this method. Higher values take precedence over lower values.function: (...any) -> ...anyReturns Type Description RBXScriptConnectionUse this connection object to remove the constraint function.DragDetector:GetReferenceFrame( ): CFrame Returns the referenceCFramein which motion is expressed.- May be invoked from a script to restart the drag using new parameters.
DragDetector:SetDragStyleFunction( function: (...any) -> ...any) Passes a function to be used if and only ifDragStyleis set toDragDetectorDragStyle.Scriptable.Parameters Parameter Description function: (...any) -> ...anyFunction for monitoringDragContinuesignals. This function receives the signal's world space cursor ray and it returns aCFramecontaining the desired location and orientation of the pivot in world space. If this function returnsnil, the object will not be moved.DragDetector:SetPermissionPolicyFunction( function: (...any) -> ...any) Passes a function to be used if and only ifPermissionPolicyis set toDragDetectorPermissionPolicy.Scriptable.Parameters Parameter Description function: (...any) -> ...anyFunction for setting the detector's interactivity. This function accepts aPlayerparameter for enabling/disabling the detector for a specific player. It also receives apartparameter indicating which specificBasePartwas clicked, such as one part within a draggableModel; this is useful for enabling/disabling the detector based on that part'sName,Color,HasTag()value, or other details.
No methods match the filters.
Events23
Object.Changed: RBXScriptSignal<( property: string)> Fires immediately after a property of the object changes, with some limitations.Parameters Parameter property: string
Instance.AncestryChanged: RBXScriptSignal<( child: Instance, parent: Instance)> Fires when theInstance.Parentproperty of this object or one of its ancestors is changed.Instance.AttributeChanged: RBXScriptSignal<( attribute: string)> Fires whenever an attribute is changed on theInstance.Parameters Parameter attribute: stringInstance.ChildAdded: RBXScriptSignal<( child: Instance)> Fires after an object is parented to thisInstance.Parameters Parameter child: InstanceInstance.ChildRemoved: RBXScriptSignal<( child: Instance)> Fires after a child is removed from thisInstance.Parameters Parameter child: InstanceInstance.DescendantAdded: RBXScriptSignal<( descendant: Instance)> Fires after a descendant is added to theInstance.Parameters Parameter descendant: InstanceInstance.DescendantRemoving: RBXScriptSignal<( descendant: Instance)> Fires immediately before a descendant of theInstanceis removed.Parameters Parameter descendant: Instance- Fires immediately before (or is deferred until after) the instance is destroyed via
Instance:Destroy(). - Fires whenever any style property is changed on the instance, including when a property is set to
nil. Instance.childAdded: RBXScriptSignal<( child: Instance)> Deprecated: This deprecated event is a variant ofInstance.ChildAddedwhich should be used instead.Parameters Parameter child: InstanceUse ChildAdded instead.
ClickDetector.MouseActionReplicated: RBXScriptSignal<(player: Player,actionType: number,)> ClickDetector.MouseClick: RBXScriptSignal<( playerWhoClicked: Player)> Fires when a player interacts with the parent of aClickDetectororDragDetector.Parameters Parameter playerWhoClicked: PlayerClickDetector.MouseHoverEnter: RBXScriptSignal<( playerWhoHovered: Player)> Fires when the parent of aClickDetectororDragDetectoris hovered over by a player.Parameters Parameter playerWhoHovered: PlayerClickDetector.MouseHoverLeave: RBXScriptSignal<( playerWhoHovered: Player)> Fires when a player's cursor hovers off the parent of aClickDetectororDragDetector.Parameters Parameter playerWhoHovered: PlayerClickDetector.RightMouseClick: RBXScriptSignal<( playerWhoClicked: Player)> Fires when a player right clicks their mouse cursor on aClickDetectororDragDetector.Parameters Parameter playerWhoClicked: PlayerClickDetector.mouseClick: RBXScriptSignal<( playerWhoClicked: Player)> Deprecated: This deprecated event is a variant ofClickDetector.MouseClick, which should be used instead.Parameters Parameter playerWhoClicked: PlayerUse MouseClick instead.
Defined byDragDetector7
DragDetector.DragContinue: RBXScriptSignal<(playerWhoDragged: Player,cursorRay: Ray,viewFrame: CFrame,vrInputFrame: CFrame?,isModeSwitchKeyDown: boolean,)> Fires when a user continues dragging the object afterDragStarthas been initiated.DragDetector.DragEnd: RBXScriptSignal<( playerWhoDragged: Player)> Fires when a user stops dragging the object.Parameters Parameter playerWhoDragged: PlayerDragDetector.DragEndReplicate: RBXScriptSignal<( playerWhoDragged: Player)> Parameters Parameter playerWhoDragged: PlayerDragDetector.DragStart: RBXScriptSignal<(playerWhoDragged: Player,cursorRay: Ray,viewFrame: CFrame,hitFrame: CFrame,clickedPart: BasePart,vrInputFrame: CFrame?,isModeSwitchKeyDown: boolean,)> Fires when a user starts dragging the object.DragDetector.RestartPhysicalDragReplicate: RBXScriptSignal<( hitPoint: Vector3)> Parameters Parameter hitPoint: Vector3
No events match the filters.