I've been learning godot and have been trying to make my own small game. Through watching various tutorials and doing the "Your first 2D game" thing in the documentation, i have been trying to spawn the enemies and player, which it seems like the enemies are spawning, but the player is not despite the code being mostly the same.
@export var player_scene: PackedScene
@export var zombo_scene: PackedScene
# Called when the node enters the scene tree for the first time.
func _ready():
set_physics_process(false)
level_init()
func level_init():
await get_tree().physics_frame
set_physics_process(true)
var player = player_scene.instantiate()
var zombo = zombo_scene.instantiate()
var zombo2 = zombo_scene.instantiate()
player.position = $PlayerSpawn.position
zombo.position = $ZombieSpawn.position
zombo2.position = $ZomboSpawn.position
add_child(player)
add_child(zombo)
add_child(zombo2)
