Flutter game controller for mobile is not show at the front of layer

40 Views Asked by At

I try to make a mobile game by using flutter flame, but the controller is not show at the front of the layer even I set priority to 10.

I try to make a priority of controller layer, but it's doesn't work. how to solve it.

1

There are 1 best solutions below

0
spydon On

Without any code it is hard to know what the exact problem is, but I would guess that you have added the controller to the game directly, instead of to the viewport. This means that the World will be rendered in front of it.

To solve this, just add the controller to the viewport like this:

camera.viewport.add(controller);