Update all instances of instance() to instantiate()

This commit is contained in:
Hugo Locurcio
2022-11-29 16:58:44 +01:00
parent f133c1ce64
commit 509804650e
15 changed files with 35 additions and 35 deletions

View File

@@ -192,7 +192,7 @@ loader.
func set_new_scene(scene_resource):
current_scene = scene_resource.instance()
current_scene = scene_resource.instantiate()
get_node("/root").add_child(current_scene)
Using multiple threads
@@ -285,7 +285,7 @@ Example:
start_cutscene()
# Later, when the user presses the pause button for the first time:
pause_menu = queue.get_resource("res://pause_menu.tres").instance()
pause_menu = queue.get_resource("res://pause_menu.tres").instantiate()
pause_menu.show()
# When you need a new scene:

View File

@@ -241,7 +241,7 @@ load function:
var node_data = json.get_data()
# Firstly, we need to create the object and add it to the tree and set its position.
var new_object = load(node_data["filename"]).instance()
var new_object = load(node_data["filename"]).instantiate()
get_node(node_data["parent"]).add_child(new_object)
new_object.position = Vector2(node_data["pos_x"], node_data["pos_y"])
@@ -282,7 +282,7 @@ load function:
// Firstly, we need to create the object and add it to the tree and set its position.
var newObjectScene = (PackedScene)ResourceLoader.Load(nodeData["Filename"].ToString());
var newObject = (Node)newObjectScene.Instance();
var newObject = (Node)newObjectScene.Instantiate();
GetNode(nodeData["Parent"].ToString()).AddChild(newObject);
newObject.Set("Position", new Vector2((float)nodeData["PosX"], (float)nodeData["PosY"]));