For some reason my notes aren't moving when the game exports? They work when testing in the editor but not when it's exported to an exe. Heres the code for spawning the notes:
var finder = note_times.find(beat)
var note = note_nums[finder]
var sound = note_sounds[finder]
var scene = preload("res://Scenes/note.tscn")
var instance = scene.instantiate()
$Notes.add_child(instance)
And here's the code for the note movement:
func _ready():
while true:
print("time5")
if $"../..".paused == 0:
position += Vector2(0,8)
await get_tree().create_timer(0.01).timeout
What I do know is that "time5" isn't printing, so _ready() probably isn't being called. Other than that, I have no clue what's wrong. Does anyone have a fix for this?
Do you get any warnings or errors? You can check the logs for exported builds by opening the game through a console or digging into the user data folder
avoid preload for large scenes and resources. Since your Note scene has a script, I’d avoid preloading it.
Use _process, do not create an infinite loop inside of _ready
func _process(delta: float) -> void:
if $"../..".paused == 0:
position += Vector2(0,500 * delta)
print() prints into a console. When you run in the editor you have the output console in the debugger. When you run the exported executable, in which console do you expect to see the printout?
Put print() into spawning code. Does that produce a printout? If not, then put print() into code that calls that code. Continue until something prints.