Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to instance in a node with code godot

#Load the resourse using preload
const MySmokeResource = preload("res://SmokeScene.tscn")

func _ready():
    #Make instance
    var GrabedInstance= MySmokeResource.instance()
    #You could now make changes to the new instance if you wanted
    CurrentEntry.name = "SmokeA"
    #Attach it to the tree
    self.add_child(GrabedInstance)
Source by godotengine.org #
 
PREVIOUS NEXT
Tagged: #instance #node #code #godot
ADD COMMENT
Topic
Name
9+9 =