Check Right Mouse Button Click Unity Code Example


Example 1: 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
}

Example 2: unity left mouse button


//Key Code in the Input Project Settings is "mouse 0"
Input.GetKey(KeyCode.Mouse0))

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android SDK Location Should Not Contain Whitespace, As This Cause Problems With NDK Tools