-
When i change type to go-defined one, godot will add nodes from type to scene tree. Same if i create a new scene from go-type with exported nodes. Is it possible to disable this behavior? Is it on go side or in godot? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
This behavior is on the Go side, can you share your use case? Previously, others have disabled this by making the field unexported but it sounds like you need the field to be exported, are you using this as a node reference? |
Beta Was this translation helpful? Give feedback.
-
@Splizard type Test struct {
Node3D.Extension[Test]
Waypoints Node3D.ID
}
func (n *Test) Ready() {
wp, ok := n.Waypoints.Instance()
if !ok {
println("Waypoints not OK")
return
}
} In godot i create a scene with root of |
Beta Was this translation helpful? Give feedback.
I'm thinking about introducing ID types to solve this, which would be typed Object Instance IDs for each class, which have a boolean on them when you retrieve them to signal whether they are still alive or not, this may also help with #130.
So for example, if I implement this, you would change the field to be this:
You can set it from the editor, or within the code:
Then when you want to borrow the Instance for a single frame:
They would be more suitable to use as references, as the
Instance
…