Home

Published

- 1 min read

detecting a right click unity

img of detecting a right click unity

The solution for this is noted below

detecting a right click unity

Solution

   function Update()
{
   if(Input.GetMouseButtonDown(0)) Debug.Log("Pressed left click.");
   if(Input.GetMouseButtonDown(1)) Debug.Log("Pressed right click.");
   if(Input.GetMouseButtonDown(2)) Debug.Log("Pressed middle click.");
}

Try other methods by searching on the site. That is if this doesn’t work