Asteroid Avoider upgrade - problem with on-screen buttons

Hi,

I was trying to upgrade Asteroid Avoider game, by adding additional buttons, allowing player to pause the game, using some bonuses like protective shield, etc. Unfortunately, as player movement script is using touchscreen - created buttons are not registering the “clicks” (player is responding on touch where button is located).

How can I solve this problem?

Thanks,
Maciej

This is a case where we have to query the EventSystem to determine if the touch is over a GameObject.

The EventSystem has a method called IsPointerOverGameObject(), but out of the box it works mainly with the MOUSE, to work with touch requires some extra work. I’ve actually detailed what method you’ll need to determine if the touch is over a Button as opposed to the playing area, and discuss it here: IsPointerOverGameObject doubt (from other project) - #5 by Brian_Trotter

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms