Reference API Roblox

Engine API

Website

Related

Reference API Roblox

Dragger

A helper object used to create tools that can drag parts.

Member index 4

HistoryMember
573AxisRotate(axis: Axis = X): null
648MouseDown(mousePart: Instance, pointOnMousePart: Vector3, parts: Instances): null
573MouseMove(mouseRay: Ray): null
573MouseUp(): null
inherited from Instance
553Archivable: bool
670Capabilities: SecurityCapabilities
723IsInSandbox: bool
553Name: string
553Parent: Instance
702PredictionMode: PredictionMode
670Sandboxed: bool
680UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
707GetDescendants(): Instances
486GetFullName(): string
706GetStyled(name: string, selector: string?): Variant
657GetStyledPropertyChangedSignal(property: string): RBXScriptSignal
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
664IsPropertyModified(property: string): bool
698QueryDescendants(selector: string): Instances
573Remove(): null
576RemoveTag(tag: string): null
664ResetPropertyToDefault(property: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
648children(): Instances
553clone(): Instance
573destroy(): null
553findFirstChild(name: string, recursive: bool = false): Instance
648getChildren(): Instances
553isDescendantOf(ancestor: Instance): bool
573remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
657StyledPropertiesChanged()
553childAdded(child: Instance)
inherited from Object
647ClassName: string
647className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
650isA(className: string): bool
647Changed(property: string)

Description

The Dragger object is a helper object used to create tools that can drag parts. It is expected (but not required) to be used with Mouse events.

Primarily used with the RbxStamper library.

History 16

Members 4

AxisRotate

Parameters (1)Default
axisAxisX
Returns (1)
null

Rotates the currently dragged part(s) by 90 degrees around the specified world axis. This method can only be called while a drag is actively in progress (after Dragger:MouseDown() has been called and Dragger:MouseMove() has initiated movement). The axis parameter defaults to Axis.X.

For single-part drags the rotation is performed about the snap face axis. For multi-part drags the rotation is applied around the computed center of the part group using a collision-aware routine that prevents overlap with surrounding geometry.

History 3

MouseDown

Parameters (3)
mousePartInstance
pointOnMousePartVector3
partsInstances
Returns (1)
null

Initializes a dragging action by registering the parts to drag and the point on the mouse part where the interaction began. This method does not immediately begin moving parts; actual movement starts on a subsequent Dragger:MouseMove() call once the mouse has moved beyond a break-free threshold (half the current grid snap distance).

mousePart must be a BasePart that is both a member of parts and a descendant of Workspace. Calling this method while a drag is already active (before Dragger:MouseUp()) throws an error. While a drag is pending, camera mouse-pan is disabled so that mouse movement applies to the drag instead of the viewport.

History 5

MouseMove

Parameters (1)
mouseRayRay
Returns (1)
null

Attempts to move the currently dragged parts to the location indicated by mouseRay. Must be called after Dragger:MouseDown().

On the first call that detects sufficient mouse movement (exceeding half the grid snap distance), the method transitions into active dragging: it un-joins the dragged parts from surrounding geometry, aligns them to the grid, and begins tracking movement. On each subsequent call, the ray is cast against other parts in the Workspace (or against the world ground plane at Y = 0 if nothing is hit), and the dragged parts are moved toward that snap point using a collision-aware algorithm that prevents them from overlapping existing geometry. Single-part drags use surface snapping; multi-part drags use grid-aligned displacement with Y-drop collision avoidance.

History 4

MouseUp

Parameters (0)
No parameters.
Returns (1)
null

Stops the current dragging action initiated by Dragger:MouseDown(). If parts were actively being dragged, this method re-joins them to adjacent geometry and finalizes their position. If MouseDown was called but the mouse never moved far enough to begin actual dragging, the state is simply reset. In both cases camera mouse-pan is re-enabled.

Calling this method without a prior Dragger:MouseDown() throws an error.

History 3

Settings