Error: Modulo by zero error in operator '%'

extends Node2D

var enemy = preload(“res://scenes/enemy.tscn”)

func _on_spawn_timer_timeout():
var enemy_instance = enemy.instantiate()
add_child(enemy_instance)
enemy_instance.position = $SpawnLocation.position

var nodes = get_tree().get_nodes_in_group("Spawn")
var node = nodes[randi() % nodes.size()]      **#Error in this line**
var position = node.position
$SpawnLocation.position = position

Capture

Did you add nodes to the Spawn group? Groups — Godot Engine (stable) documentation in English

Thanks i am a beginner. I wasn’t aware of groups