Godot 4: Callbacks when changing scenes #11
Labels
enhancement
New feature or request
waiting for godot
Waiting for responses from the godot team or an engine update
Is your feature request related to a problem? Please describe.
Would like to solve the confusion/issues proposed in #8, without internally setting variables on the new scene in an obscure way.
Also would like to give as much control to the users of this library as possible without bloating it.
Describe the solution you'd like
A "hook" or "callback" sent to SceneManager when the new scene enters the tree and/or becomes ready. It should recieve the new scene and allow for direct modifications there. I'm imagining something like this:
This would be a great feature to implement when Godot 4 releases, since it makes very good use of the new lambda functions feature.
Additional context
Unfortunately, I don't think there's a very good way to do this in Godot 3.x.
I don't think a FuncRef would work since the original scene that calls this function would most likely already be unloaded, and the logic in a separate static method seems like it would be more of a hassle than just using a regular Autoload or custom solution.
I also considered using "expressions" and evaluating them internally, but that also feels limiting and extremely hacky.
The text was updated successfully, but these errors were encountered: