Aego Playground

aego/scenemodule

Destroyfunction

func Destroy(node NodeRef)

Destroy removes a node and its children at the end of the phase.

Example

scene.Destroy(Target)

Findfunction

func Find(path string) NodeRef

Find returns the node at a path from the scene root, or nil.

Example

spawn := scene.Find("Level/Spawn")

Instantiatefunction

func Instantiate(prefab AssetRef<prefab>, parent NodeRef) NodeRef

Instantiate creates a copy of a prefab under parent, or under the root when parent is nil. The new nodes appear at the end of the phase; their scripts get Ready before the next Update.

Example

b := scene.Instantiate(Bullet, nil)
b.SetPosition(node.WorldPosition())