Input.GetMouseButtonDown Code Running When Canvas Buttons Pressed
I am making a shooting game and when user clicks on the screen the shooter shoots. The problem i am having is when user click ui buttons the shooter still shoots. Shooting code is in FixedUpdate in Input.GetMouseButtonDown Tried to handle but nope didnt work.
Goo day.
You need to google for the solution of:
How to detect if my mouse is over a UI element?
So when Input.Get$$anonymous$$ouseButtonDown need to also know if mouse was or not over ui.
Another way is to detect what you click, and activate it only is clicking an enemy or soething...
Bye!
@tormentoarmagedoom the thing is the game is made for mobile phones and i cannot use mouse over function.
Your answer
Follow this Question
Related Questions
Does GraphicRaycaster.Raycast produce more reliable results in Update or FixedUpdate? 0 Answers
UI Button OnClick Only Works the First Time 2 Answers
How do I change a state in an FSM with an UI button? 0 Answers
UI Button not accurate 1 Answer
What is the difference between Update() , LateUpdate() , FixedUpdate(), and when i should use them 3 Answers