func new_game():
player = player_scene.instantiate()
player.global_position = player_spawn_position
add_child(player)
camera = camera_scene.instantiate()
camera.setup_camera(player)
add_child(camera)
if player:
level_generator.setup_level_generator(player)
Here we instantiated the Player scene in gdscript, a few lines later we check if player exists and then call the setup_level_generator(player)
function.
If we remove the if statement, is there a way that the player will be null
?