Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

how to detect a mouse click in unity

using UnityEngine;
using System.Collections;

		if (Input.GetMouseButtonDown(0)) {
        	//Left Mouse Button
        } else if (Input.GetMouseButtonDown(1)) {
        	//Right Mouse Button
        } if (Input.GetMouseButtonDown(2)) {
        	//Middle Mouse Button
        }
 
PREVIOUS NEXT
Tagged: #detect #mouse #click #unity
ADD COMMENT
Topic
Name
6+6 =