PcoWSkbVqDnWTu_dm2ix
Collapse Sidebar

Target

Mouse

BasePart

The object in 3D space the Mouse|mouse is pointing to.

Notes

  • If Mouse/TargetFilter has been set, the target filter and its descendants will be ignored.
  • When the mouse is not pointing at a BasePart, for example when it is pointing at the sky, Target will be nil.
  • Developers looking for the position of the mouse in 3D space should use Mouse/Hit.


Code Samples


Color Randomizer Tool

The following code sample, when placed in StarterPlayerScripts will create a tool in the player’s backpack that, once equipped, will change the BasePart/BrickColor of every BasePart the player clicks on.