Skip to content

What are the @export and @onready equivalents? #43

Answered by Splizard
Ullanar asked this question in Q&A
Discussion options

You must be logged in to vote

Any exported fields in the Go struct will be exported to Godot (just like @export)
https://go.dev/ref/spec#Exported_identifiers

type MyClass struct {
    gd.Class[MyClass, Node]
    
    Camera gd.Camera3D `gd:"camera"`
}

If you add an exported node field to a node, it will be asserted as a child, so in the above example, the Camera will be added as a child node of MyClass.

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
5 replies
@Ullanar
Comment options

@Splizard
Comment options

@mdevnull
Comment options

@Ullanar
Comment options

@Ullanar
Comment options

Answer selected by Splizard
Comment options

You must be logged in to vote
3 replies
@Splizard
Comment options

@Ullanar
Comment options

@Splizard
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants