Connect a Click Event not in CanvasLayer

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By SuperPigeon

Hi everyone !
I’m developing a micro-party-game like Warioware, and I’m coding some micro games.

In my game conception, I prefered to separate my work in two scenes : one for the “lives counter” scene, and another one for the chosen microgame. These scenes will be running simultaneously (like the example video in the link below). Both has a script.

Warioware Gameplay here !

For my “Lives Counter Scene”, I chose a CanvasLayer type. However, I would like to add a button which could be clicked for the minigame.

I’m adding my microgames elements dynamically in my second Scene, that’s why I have to connect a TextureButton to click on it.

When I’m only lauching the microgame scene, it works. But when I’m instanciating it in the main one Scene, the click event doesn’t seem to work (the button sprite doesn’t even change when it’s pressed).

Here is a screenshot :

Does anyone has an idea for managing the click event, please ?
Thanks for the answer.

It looks like you need to facilitate something which connects the two. You may have to use either a singleton, or use basi various signals to connect the scenes.

Ertain | 2018-09-23 23:42

:bust_in_silhouette: Reply From: SuperPigeon

Thanks for the reply, Ertain !

Hum, actually… Connection between the main scene and the child one was already made and it worked… There was ONLY ONE blocking element in my parent, and the problem was hum… Really frustrating, as you could see in the picture ^^’

Mouse filter, able to break your mind !

I'm just so dumb...

Thanks anyway !