Answers for "how to fix on Input.GetMouseButtonDown(0) conting as ui"

C#
0

how to fix on Input.GetMouseButtonDown(0) conting as ui

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

Code answers related to "how to fix on Input.GetMouseButtonDown(0) conting as ui"

C# Answers by Framework

Browse Popular Code Answers by Language