Skip to content
Roblox API Reference

DragDetector

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

Inherited fromObject2

Property categoryData

Inherited fromInstance21

Property categoryBehavior

Property categoryData

Property categoryPermissions

Inherited fromClickDetector3

Property categoryData

Property categoryImage

Defined byDragDetector31

Property categoryBehavior

Property categoryData

  • DragDetector.ReferenceInstance: Instance
    An instance whose CFrame is the reference frame for the drag detector.
    • Read capabilities: Input + Physics

Property categoryDrag Directions

  • DragDetector.Axis: Vector3 = Vector3.new(0, 1, 0)
    The primary axis of motion, expressed relative to the reference frame.
    • Not replicated
    • Read capabilities: Input + Physics
    • Load only
  • DragDetector.Orientation: Vector3 = Vector3.new(-0, 180, 90)
    Specifies the YXZ rotation of axes of motion relative to the reference frame.
    • Read capabilities: Input + Physics
  • DragDetector.SecondaryAxis: Vector3 = Vector3.new(1, 0, 0)
    The secondary axis of the motion.
    • Not replicated
    • Read capabilities: Input + Physics
    • Load only
  • DragDetector.WorldAxis: Vector3 = Vector3.new(0, 1, 0)
    The Axis expressed in world space.
    • Not replicated
    • Read capabilities: Input + Physics
    • Load only
  • DragDetector.WorldSecondaryAxis: Vector3 = Vector3.new(1, 0, 0)
    The SecondaryAxis expressed in world space.
    • Not replicated
    • Read capabilities: Input + Physics
    • Load only

Property categoryDrag Limits

  • DragDetector.MaxDragAngle: number = 0
    Along with MinDragAngle, impedes the drag detector's attempts to generate motion.
    • Read capabilities: Input + Physics
  • DragDetector.MaxDragTranslation: Vector3 = Vector3.zero
    Along with MinDragTranslation, impedes the drag detector's attempts to generate motion.
    • Read capabilities: Input + Physics
  • DragDetector.MinDragAngle: number = 0
    Along with MaxDragAngle, impedes the drag detector's attempts to generate motion.
    • Read capabilities: Input + Physics
  • DragDetector.MinDragTranslation: Vector3 = Vector3.zero
    Along with MaxDragTranslation, impedes the drag detector's attempts to generate motion.
    • Read capabilities: Input + Physics

Property categoryDragged Amount

Property categoryImage

  • DragDetector.ActivatedCursorIcon: string = ""
    Sets the cursor icon to display when the mouse is activated over the parent of this DragDetector.
    • Read capabilities: Input + Physics
  • DragDetector.ActivatedCursorIconContent: Content
    Sets the cursor icon to display when the mouse is activated over the parent of this DragDetector. Only supports asset URIs
    • Read capabilities: Input + Physics

Property categoryInternal

  • DragDetector.PhysicalDragClickedPart: Instance
    • Hidden
    • Not scriptable
    • Read capabilities: Input + Physics
  • DragDetector.PhysicalDragHitPoint: Vector3 = Vector3.zero
    • Hidden
    • Not scriptable
    • Read capabilities: Input + Physics
  • DragDetector.PhysicalDragIsInVR: boolean = false
    • Hidden
    • Not scriptable
    • Read capabilities: Input + Physics
  • DragDetector.PhysicalDragTargetFrame: CFrame = CFrame.identity
    • Hidden
    • Not scriptable
    • Read capabilities: Input + Physics

Property categoryMode Switching

  • DragDetector.GamepadModeSwitchKeyCode: Enum.KeyCode = Enum.KeyCode.ButtonR1
    During gamepad input, the modifier KeyCode for the secondary mode of motion.
    • Read capabilities: Input + Physics
  • DragDetector.KeyboardModeSwitchKeyCode: Enum.KeyCode = Enum.KeyCode.LeftControl
    During keyboard input, the modifier KeyCode for the secondary mode of motion.
    • Read capabilities: Input + Physics
  • DragDetector.VRSwitchKeyCode: Enum.KeyCode = Enum.KeyCode.ButtonL2
    During VR input, the modifier KeyCode for the secondary mode of motion.
    • Read capabilities: Input + Physics

Property categoryPhysics Response

  • DragDetector.ApplyAtCenterOfMass: boolean = false
    Whether constraint force is applied to the object's center of mass.
    • Read capabilities: Input + Physics
  • DragDetector.MaxForce: number = 10000000
    Maximum force applied for the object to reach its goal.
    • Read capabilities: Input + Physics
  • DragDetector.MaxTorque: number = 10000
    Maximum torque applied for the object to reach its goal.
    • Read capabilities: Input + Physics
  • DragDetector.Responsiveness: number = 10
    Higher values cause the object to reach its goal more rapidly.
    • Read capabilities: Input + Physics

Methods47

Inherited fromObject3
  • Get an event that fires when a given property of the object changes.
    Parameters
    ParameterDescription
    property: string
    The property to connect to.
    Returns
    TypeDescription
    RBXScriptSignal
    A signal that fires whenever the property changes.
  • Object:IsA(className: string): boolean
    Returns true if an object's class matches or inherits from a given class.
    • Custom Lua state
    • Thread safe
    Parameters
    ParameterDescription
    className: string
    The class against which the Object's class will be checked. Case-sensitive.
    Returns
    TypeDescription
    boolean
    Describes whether the Object's class matched or is a subclass of the given class.
  • Object:isA(className: string): boolean
    Deprecated: This deprecated function is a variant of Object:IsA() which should be used instead.
    • Deprecated
    • Custom Lua state
    Parameters
    Parameter
    className: string
    Returns
    Type
    boolean

    Use IsA instead.

Inherited fromInstance39
Defined byDragDetector5
  • DragDetector:AddConstraintFunction(priority: number,function: (...any) -> ...any,): RBXScriptConnection
    Adds a function to modify or constrain proposed motion.
    • Capabilities: Input + Physics
    Parameters
    ParameterDescription
    priority: number
    The order of priority for functions added via this method. Higher values take precedence over lower values.
    function: (...any) -> ...any
    Function for modifying or constraining proposed motion. This function takes an input CFrame of proposed motion and returns a CFrame of modified or unmodified motion, both relative to the reference frame.
    Returns
    TypeDescription
    RBXScriptConnection
    Use this connection object to remove the constraint function.
  • DragDetector:GetReferenceFrame(): CFrame
    Returns the reference CFrame in which motion is expressed.
    • Capabilities: Input + Physics
    Returns
    TypeDescription
    CFrame
    The reference CFrame in which motion is expressed.
  • DragDetector:RestartDrag()
    May be invoked from a script to restart the drag using new parameters.
    • Capabilities: Input + Physics
  • DragDetector:SetDragStyleFunction(function: (...any) -> ...any)
    Passes a function to be used if and only if DragStyle is set to DragDetectorDragStyle.Scriptable.
    • Capabilities: Input + Physics
    Parameters
    ParameterDescription
    function: (...any) -> ...any
    Function for monitoring DragContinue signals. This function receives the signal's world space cursor ray and it returns a CFrame containing the desired location and orientation of the pivot in world space. If this function returns nil, the object will not be moved.
  • DragDetector:SetPermissionPolicyFunction(function: (...any) -> ...any)
    Passes a function to be used if and only if PermissionPolicy is set to DragDetectorPermissionPolicy.Scriptable.
    • Capabilities: Input + Physics
    Parameters
    ParameterDescription
    function: (...any) -> ...any
    Function for setting the detector's interactivity. This function accepts a Player parameter for enabling/disabling the detector for a specific player. It also receives a part parameter indicating which specific BasePart was clicked, such as one part within a draggable Model; this is useful for enabling/disabling the detector based on that part's Name, Color, HasTag() value, or other details.

Events23

Inherited fromObject1
Inherited fromInstance9
Inherited fromClickDetector6
Defined byDragDetector7