@Vale-git said:
@Somnivore said:
@Vale-git said:
Thank you for your answer :)
However it is not clear to me what you mean when you say "space between".
Can you give me an simple example in code please?
Thank you.
func LoadAScene(with_a_parameter):
#scene loading logic
var inst = scene.instance() #instantiated, but not active in the hierarchy
# T H E S P A C E
inst.parameter = with_a_parameter
# B E T W E E N
add_child(inst) #active in the hierarchy, as a child of this node
Ha.. that ones..
I wonder if exist something like this:
onready var _myScene= preload("res://myScene.tscn") myParameter
Or the same result is obtained with your example?
Thank you.
Preloading a scene doesn't instantiate it, it just cuts out the loading bit. It wouldn't make sense to do it that way, as it would imply all your instances from then forth will have myParameter, and if that's the case you might as well just make that a part of the scene. To my knowledge there's no such functionality like that, and likely never will be.