Hey,
So I’m developing a platformer that uses 'Input.GetMouseButtonDown’ in order to allow my player character to jump.
I’ve since started developing a pause mechanic for my game which in essence successfully works. Unfortunately, it fails to work perfectly with the Button UI element. When playing the game in the editor and tapping the button UI element - my game will successfully pause however my player will also jump. I’ve tried replacing the self-implemented “On Click()” function with ‘Event Triggers’ as well as an assortment of other attempted fixes.
I was thinking of using a coroutine in order to slightly delay the input so that a bool or int may ring true before the jump is initiated… but surely there’s a more practical solution; a more convenient way around the conundrum of the UI element using a duplicate input of that used in the game?
There’s something simple I’m missing surely?
Thanks.
Thanks for pointing me in the right direction - I ultimately decided on using 'OnPointerEnter' and 'OnPointerExit' for my solution. Thanks.
– Darius0995