Godot Version
4.3
Question
hi folks.
I have a scene (a car) with another scene (car cosmetics) inside of it.
In the editor I’ve right clicked the sub scene and checked “make editable children”; So I’m able to drag nodes into the parent scene’s script to get a reference.
ex:
@onready var right_back_wheel: MeshInstance3D = $"CarMesh/wheel-back-right"
Now that I’m trying to make the car less prototype & more game ready, I want to be able to swap out the car cosmetics scene as needed.
What’s the best way to expose sub-scene elements to the parent script if it’s not “editable” or “local”?
- @export vars may help but such references are usually @onready … that hurts my brain.
- I thought perhaps unique names, but it doesn’t look like that would work.
- I suppose I could write functions to expose everything I want to do, but… ugh.
- Groups feel messy.
Looking for best practices…
THANKS!