I have a game with canvas menu on screen with button in it.When user clicks screen,our player jumps.Click on anywhere on screen.
And my button provides player can fire.
So when user touches Button my player jumps and fire.But I just want make it fire not jump.
How can I detect when user clicks button ?
Edit : Thank u guys This Code Solved my Problem ;
if (Input.GetMouseButtonDown(0))
{
if (EventSystem.current.IsPointerOverGameObject())
{
Debug.Log("Clicked on the UI");
}
else
{
jump();
}
}