Godot Version
4.3
Question
I’m encapsulating game objects in Scenes, as it seems to be the best way to organize project hierarchy in Godot. Now, usually, those “scenes” have parameters I need to set on each instance, so I apply a script to the root component and export some variables.
However, when looking at the scene instance in the inspector, I don’t see those properties.
Let me explain it better:
- I have a scene called “Player”:
player
∟sprite
To player (the scene root), I apply a small script like:
extend Node2D
@export var name
func _ready() -> void:
pass
Then, in another scene, I have the following:
main
∟player
where player is a instance of the scene above. If I select it on the inspector, I would expect to see a “name” variable there, but I don’t. So it seems like scenes instances are treated as their “base” type by the inspector, instead of the type of the script.
Is that how Godot works? Am I missing something? How do I created a “parametized” scene, so to speak?