Godot Version
4.2.1
Question
I’m making something in 2D and I have a problem with get_child().get_child(), I’m not even sure if this is a thing that’s possible, but I couldn’t find anything about it on the internet
I have a Node2D with a bunch of scene instances (Node2Ds) with two sprites, named “Red” and “White”. In the first Node2D I have this script:
extends Node2D
func _process(delta):
var count = get_child_count()
for i in count:
get_child(i).get_child(0).position = Vector2.ZERO
get_child(i).get_child(1).position = Vector2.ZERO
if get_node("/root/Global").visualEffectsOn == false:
get_child(i).queue_free()
With this, get_child(i) works, but if I try to get a child of that, it doesn’t. How do I fix this?
Thank you