Godot Version
Godot 4.2.1
So this is my code:
extends Node
onready var sprite2D = preload(“res://sprite_2d.tscn”)
func _ready():
for i in range(10):
var s = Sprite2D.instance()
add_child(s)
Basically im trying to make multiple sprites spawn and bounce around the screen ( i already made another code to do it with the main sprite ). However i keep getting the two erors: Unexpected “Identifier” in class body. and Expected indented block after “for” block.
Im really confsued about these errors and when i try to play the scene only the 1 sprite spawns and not 10.
If there is any other information you need to know to find the solution to this situation please let me know!