Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | fase45 |
I have tiles stored in an array like this:
road_dificulty = ((randi() % road_type.size()))
var new_road = road_type[road_dificulty].instance()
tile_list.push_back(new_road)
add_child(new_road, true)
new_road.translation = Vector3(0, 0, 1) * spawn_z
spawn_z += tile_legnth
old_road = road_dificulty
I am trying to remove the first mesh added in the array so that I can get better performance and stop rendering it.
I tried:
var first_tile = tile_list.front()
first_tile.queue_free()
that didtn’t work. So I’m still unsure how to free the remove the object from the array because the mesh is still there when I run this code