I have a script to changes the scene when a button is clicked. Because the scene that holds this script is preloading a scene that preloads the first scene, I get this error:
E 0:00:01.795 load: Resource: 'res://scenes/CityStreet.tscn' is already being loaded. Cyclic reference?
Is there a way to be able to reference scenes to each other without creating a cyclic reference?
The script in question:
export var next_scene_path: PackedScene
func _get_configuration_warning() -> String:
return "No scene loaded" if not next_scene_path else ""
func transition() -> void:
var next_scene = next_scene_path.instance()