Answers for "unity getmousebuttondown mobile"

C#
2

GetMousebuttonDown unity

if (Input.GetMouseButtonDown(1))
//This is too stop spaming the gun
Posted by: Guest on July-23-2020
0

how to fix on GetMouseButtonDown activating UI unity

using UnityEngine.EventSystems;

void Update()
{
	if (Input.GetMouseButtonDown(0))
    {
         // This line prevents the Code from activating UI
    	 if (EventSystem.current.IsPointerOverGameObject())
                return;
         // Put your code here       
    }
}
Posted by: Guest on July-31-2020

C# Answers by Framework

Browse Popular Code Answers by Language