MouseDown (Method)

From Legacy Roblox Wiki
Jump to navigationJump to search
MouseDown( Instance MousePart, Vector3 PointOnMousePart, table Parts )
Returns nil
Description: Initializes a dragging action, specifying which parts to use when dragging.
Member of: Dragger


Notes

  • Initializes a dragging action.
  • Once this has been called, it cannot be called again until MouseUp has been called.
  • Generally called with Mouse.Button1Down.

Arguments

MousePart:

  • The primary dragging part.
  • All parts will be dragged relative to this part.
  • Generally will be Mouse.Target.

PointOnMousePart:

  • The relative position to MousePart.
  • The Mouse will center exactly on this point when dragging.
  • Generally will be Mouse.Target.Position - Mouse.Hit.p</syntaxhighlight>

Parts:

  • A list of parts that will be dragged along with the MousePart.
  • MousePart must be somewhere in this list.
  • The CFrames of each part are kept relative to the MousePart when dragging.
  • Only BaseParts are allowed in the list.
  • Parts that appear multiple times in the list will behave unexpectedly (i.e. dragging is applied to that part multiple times)

See Also