MouseDown (Method): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Anaminus
Adding info
m Text replacement - "</SyntaxHighlight>" to "</syntaxhighlight>"
Tags: mobile web edit mobile edit
 
(One intermediate revision by the same user not shown)
Line 22: Line 22:
*The '''relative''' position to ''MousePart''.
*The '''relative''' position to ''MousePart''.
*The Mouse will center exactly on this point when dragging.
*The Mouse will center exactly on this point when dragging.
*Generally will be <code>Mouse.Target.Position - [[Hit|Mouse.Hit]].p</code>
*Generally will be <code>Mouse.Target.Position - [[Hit|Mouse.Hit]].p</syntaxhighlight>


''Parts'':
''Parts'':

Latest revision as of 05:13, 27 April 2023

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