Overview - Mouse input (GetMouseButton, position)
What is it?
Mouse input in Unity lets your game detect when and where the player clicks or moves the mouse. The GetMouseButton method checks if a mouse button is pressed, held, or released. The mouse position gives the exact screen coordinates of the cursor. Together, these let your game respond to player actions with clicks and cursor movement.
Why it matters
Without mouse input, games would feel static and unresponsive to player actions. Mouse input allows interaction like clicking buttons, aiming, dragging, or selecting objects. It makes games feel alive and lets players control the game world naturally. Without it, many game genres would be impossible or frustrating.
Where it fits
Before learning mouse input, you should understand basic Unity scripting and the Update method. After mastering mouse input, you can learn about raycasting to detect objects under the cursor or advanced input systems for touch and controllers.