hi all,
i am using this function to get where a player has clicked and then move the character accordingly.
if (Input.GetKeyDown(KeyCode.Mouse0))
{
rubyPosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
}
I have added a ui button for shooting. This button is on screen space. Unfortunately my movement is triggered by the button too.
Is there an elegant way or best practice to move by click but not when on an ui button?
Could check for mouse cursor hovering over the button and if so flip a boolean true and if not false; then the world space object checks and if true they abort prior to executing movement code.