Mouse Inputs dont work in main scene

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

In my game, i tried following this video as a guide to making a small in-game shop of my own, what i did was just as the video suggests and start with a shop StaticBody2D node and instance that into my main scene. Whenever I test the scene with JUST the staticbody, all the inputs work fine, whenever I add it to my main scene, no mouse inputs are being registered. I know I have it on the top layer so its not being blocked by anything, not sure what else to check.

As for code, I basically copied him, there really isnt any code when placing buttons so its weird to me that the buttons just refuse to work on the main scene.

Edit: Just did some more testing, problem still persists, I realize its not the instance of the shop though since if I just add a new dummy button to the main scene not tied to anything else, that also won’t get registered so Its something to do with the main scene I believe

EDIT 2: Ok so I got buttons to work by connecting them to canvas layers within the child scene, makes it kind of ugly to work with but its fine, my current issue is no matter what I try, I CANNOT drag and drop objects in the main scene, if i run the objects im trying to move in a scene by theirselves, it works just fine, whenever i instance them in main, they dont accept any mouse input. I desperately need help here now lol

Any advice helps thanks!

I saw somewhere that using a canvas layer messed it up way back in 2020, not sure if that issue is resolved now but i am using a canvas layer to keep my UI centered in on the camera when in the pause menu so maybe thats the issue ? if so im still not sure how to resolve it

nelsontorresjr330 | 2023-04-19 06:50

:bust_in_silhouette: Reply From: nelsontorresjr330

I figured it out, my canvas layer had a gui that displayed gold & i didnt realize it took up the entirety of the camera in the scene so it was blocking all mouse inputs