Consuming input and not passing it to proxy loaded world

Hello,
I am a new user, finding it good so far.

Probably making some error in understanding how device input can be marked consumed. I have read this part of documentation..

In my game there is a main collection which has a GUI, presenting a start game button. This start game button triggers loading a collection via a collection proxy (let us called that as level). The main collection looks something like the following

  • gui (level selector)
  • loader (it has a reference to another collection proxy).

The collection proxy called level reference in the loader.

The problem is: the click on the start game button gets passed to the ā€˜levelā€™ too. The player, which moves in point-and-click fashion ends up moving as soon as the level is starting up.

Iā€™m returning true in the on_input method in the level selector GUI (which is part of main/boostrap collection) , to avoid this very first input being passed on to the proxy. But it still receives the input. Am I doing something wrong?

Are you sure the gui is getting the input before your game? You can call ā€œacquire_input_focusā€ again to move a script to the top of the input stack.

1 Like

Another option is to not acquire input focus in your game on init() but as the result of a message sent to the game after the start button has been pressed.

1 Like

This one seems like the right option. I will try this out and update here. Thanks!

1 Like

I solved this by making the game not having input focus by default. It waits a couple of seconds and then acquires input status.

Indeed hacky, but being a newbie, I want to move on to the next steps. Perhaps, Iā€™ll come back to doing this later. I might have to spend more time understanding how input consuming stacks work with loading collections via proxies.

Thanks for the solution though!

3 Likes