MouseMove (Method)

From Legacy Roblox Wiki
Jump to navigationJump to search
MouseMove( Ray MouseRay )
Returns nil
Description: Tries to move the currently dragged part to the point where MouseRay hits another part.
Member of: Dragger


Notes

  • Moves MousePart to the point where MouseRay hits another part.
  • MouseRay must hit another part in order for MousePart to move.
  • Objects that are in the group of Parts are ignored by MouseRay.
  • Objects in the group of Parts are moved to compensate for collisions with other parts.
  • The MousePart's position is snapped to an increment of 1 stud, and it's rotation is snapped to 90 degrees, relative to the part MouseRay intersects with.
  • Cannot be called before MouseDown or after MouseUp.
  • Generally used with Mouse.Move.

Arguments

MouseRay:

  • A Ray used to determine where MousePart will be moved.
  • Generally will be Mouse.UnitRay.

Bugs

  • Selected parts will not move if the ray points upwards the first time MouseMove is called. They will move normally once the ray points downwards.

See Also