How can i move the position of the child

Godot Version

4.2.2

Question

im making a proyect when if the timer goes beyond 200 it makes a child of the same node but i have no idea how to move the child position

func _process(delta):
	timer -= 1
	print(timer)
	if timer < 1:
		queue_free()
		pass
	if timer > 200:
		add_child($".")
		pass

thank you

you probably want to duplicate the node

func _process(delta):
	timer -= 1
	print(timer)
	if timer < 1:
		queue_free()
	if timer > 200:
		var clone := duplicate() as Node2D
		clone.position = # where you want it to go?
		add_child(clone)
2 Likes