-
-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Signal Scope? #360
Comments
Maybe one solution would be to have a reference to the local node in the top node, and to call the signal through the reference in the top node? |
I'm having a bit of trouble seeing how you are using Dialogue Manager with the given example, and it seems like more general Godot behavior on how signals work. This said, signals in Godot are not emitted through a global bus. When a signal is emitted, only objects that connected the specific emitting instance will receive the signal. So in your case, you would need to connect the signal from your I will also add that if you want to use an event bus so that you can receive signals from anywhere within your code from anywhere else, without having to go through specific If my analysis of your issue was wrong, don't hesitate to correct me. |
Assuming a node is available in the current scene (eg. |
Describe the bug
When trying to emit a signal that's not in the top most level, it is not picked up.
I have a signal inside one of my Nodes that I would like to call by name, however, it seems that unless the signal is stated in the top most node, it is not picked up when emitted. Is there a way to "expose" local node signals to the global scope?
Affected version
To Reproduce
Steps to reproduce the behavior:
Place a signal in a node script that is not the top most node.
Try to emit that signal and see if it is being picked up.
When I launch a scene A only, with the signal in the scene A's script, it is picked up. However, when I launch the scene A as a child of scene B, and try to emit the same signal, it is not picked up.
Expected behavior
All signals are equal, or there is a way to specify a global signal
Screenshots
![image](https://private-user-images.githubusercontent.com/20686136/280191796-ddceeb47-35e9-4f57-a027-8dc280fc409d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE4ODI1OTAsIm5iZiI6MTcyMTg4MjI5MCwicGF0aCI6Ii8yMDY4NjEzNi8yODAxOTE3OTYtZGRjZWViNDctMzVlOS00ZjU3LWEwMjctOGRjMjgwZmM0MDlkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1Dcm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VhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.QbHRVF7vIjo7Nofv4sM-O67hGWj1T1PgHfdCDI5WBFQ)
If applicable, add screenshots to help explain your problem. Try to include as much detail as possible.
Set up where signal is picked up:
Inside of "Outside" script.
Set up where signal is not picked up:
![image](https://private-user-images.githubusercontent.com/20686136/280191986-40599fdb-5c3e-48f8-bff4-da5f3414f6b7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE4ODI1OTAsIm5iZiI6MTcyMTg4MjI5MCwicGF0aCI6Ii8yMDY4NjEzNi8yODAxOTE5ODYtNDA1OTlmZGItNWMzZS00OGY4LWJmZjQtZGE1ZjM0MTRmNmI3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI1VDA0MzgxMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRjYzg4MTExNTFlYTFlODhjNmM3OTRhOTk3ZjMxMzBiNTYwNDEwODdhZmMwZTZmN2E5ZTliNWJlYzk4NjFjMWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.9iJolbmRDh_JKQ4Tg6cpC_HiuEbWQQAg2YP7nV_qwaA)
Main Node:
World, Outside are separate levels. When I replace World with Outside, and try to call the same signal, it is not picked up.
I hope this is clear, let me know if i can provide more details
The text was updated successfully, but these errors were encountered: