0 votes

I have a scene (elevator_panel.tscn) that includes a few texture buttons. If I run that scene on it's own, the texture buttons work as expected. When I place an instance of that scene into my elevator scene (that includes sprites, collision, area triggers etc), it also works.

But when I then drop that into my main scene, the buttons no longer work (no hover/pressed behavior).

I'm not sure why the elevator_panel would work when it's a child of one scene, but not the other. The only thing I can think of is that my main scene has a canvas layer I'm using for the HUD. I wonder if there's some rule that texture buttons in a scene that already has a canvas layer have to be part of it or something?

Meh, i did a poor job explaining it, but if you've seen this before and know of an answer, I'd appreciate it.

Cheers!

in Engine by (72 points)

2 Answers

0 votes
Best answer

Ah figured it out. It was the canvas layer. I had to set it to ignore mouse (it was blocking it).

by (72 points)
0 votes

I know that you answered your own question, but in case any other dev gets here: The best way to determine what exactly "has been clicked" is by using the "clicked control" part of the debugger.

Instructions:
1.- Run your scene using the play button (top right corner), move it to another monitor/place so it doesn't bother you.
2.- While the scene is running, on the Godot editor window look for the "output", and click on "debugger" (see pic below)
3.- Inside the debugger, look for the last tab "misc", there you will find useful information (take special notice of the "clicked control" input), click on any place on the scene you're trying to debug to test it, each time the user clicks on a clickable node, you will find the info there.

Good luck

Clicked control - Godot debugger

by (18 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.