Hi, everyone. I´d like your help to solve this problem I have, please. ( English isn`t my mother tongue)
I have a scene with all their buttons that work perfectly, but when I touch on a part of the screen where there was a button from the previous scene, the action of the button is executed, it seems that the button from the previous scene is active in the following scenes, something that is really bad because, It is a button to change the scene and if I touch that specific part of the screen many times, (where there aren´t buttons) I change the scenes until the end of the game.
If your are using different layers to show different buttons just check if the layer is visible then do actions
Suppose you have Level select 1 layer the level buttons goes from 1 to 10 and LevelSelect 2 where the buttons goes from 11 to 20
Then just put all your touch related events inside a main conditional event like
if LevelSelect1 layer is visible
Do your touch settings here
if LevelSelect2 layer is visible
Do your touch settings here
Thank your very much for all your suggestions and advices. I checked again the scenes and the problem is related to the layers, what you said is true, the layer where there are buttons is not visible but, they are active, that’s the reason when I click on some parts the buttons that are in the not visible layers are triggering actions.
How could I solve that? Is it a wrong way to manage the layers or is it a code issue.
Well, I don’t no know if this is the best option but I decided to delete the buttons that aren’t used after a specific action and if I need a button again, I create one in a specific point where I need it and it works. Thanks.