So this code had been working, I freshened it up a bit and edited some parts, and now suddenly a part of the code that wasn't having an issue is returning an error. I am unsure where the error lies. It is invalid get index '0' on base Array[node], it is an error on the first line of move_turn().
extends Node2D
@onready var arr_ship = get_tree().get_nodes_in_group("spaceships")
var i = 0
func start_turn():
arr_ship = get_tree().get_nodes_in_group("spaceships")
for ship in arr_ship:
ship.movement = ship.movement_max
func move_turn():
if arr_ship[i].active == true:
accel.visible = true
decel.visible = true
turn_l.visible = true
turn_r.visible = true
elif arr_ship[i].active != true:
accel.visible = false
decel.visible = false
turn_l.visible = false
turn_r.visible = false