Scenes not loading in exported project.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Kirottu

In the editor when the project is played and the main scene starts everything is fine. The play button works and loads the scene which contains the level. But when i decide to export the project the button just shows the click animation but nothing happens. this is my script that controls the main menu:
extends Control

onready var highscoreLabel = get_node("HighScore")

var file = File.new()

func _ready(): if !file.file_exists("user://highscore.dat"): file.open("user://highscore.dat", File.WRITE) file.close() print("creating save file") else: file.open("user://highscore.dat", File.READ) var content = file.get_as_text() highscoreLabel.set_text("highscore: " + content) print("reading save file")

func _on_Aloita_Peli_pressed(): get_tree().change_scene("res://Levels/Level.tscn")

func _on_Lopeta_Peli_pressed(): get_tree().quit()

Any help would be appreciated!

Maybe
change_scene_to(load("res://Levels/Level.tscn"))

MrMrBlackDragon | 2020-01-23 01:14