- Home /
2 canvases working weird with buttons
I have a game with 2 canvases. One for when the player is moving around normally, and one for battles. The battle canvas is working fine, but when i add buttons to the player canvas i get weird interactions. It seems like the buttons on the battle canvas gets activated when i click on the player canvas, and most of the screen for the player doesnt even let me click the buttons.
Is it just me having troubble with buttons?
Are the canvases overlapping one another? Because if they are, the buttons might be too and the button click might be registering through the canvas.
Try toggling "blocks raycasts" when you bring up the player canvas over the battle one just to be sure you are not raycasting to anything underneath and make sure the button that is being activated's rect (not the graphic but the interactable part) is not stretching the whole canvas, if all else fails try setting the buttons intractability to false when a canvas is show above them, or just disable any hidden canvases. (assu$$anonymous$$g the player canvas completely covers the battle canvas).