oninstance var #4323
Closed
LoneDespair
started this conversation in
Scripting
oninstance var
#4323
Replies: 1 comment
-
You opened this discussion first, but mine describes the problem and the solution in more detail, plus it got more response. So I'm closing this discussion. If you want to add something, please write in #5718. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The onready var is a great and safe way of getting references, but does have a bit of a problem
Most scripts are initialized at _ready function, but data/overwrites that needs to be distributed on a scene for setup, is only propagated after ready
So why not just call the setup function again after propagating your data?
So just stop putting your setup function on _ready func
There are plenty of workarounds, but they all have a some drawbacks
Beta Was this translation helpful? Give feedback.
All reactions