Code isn't working on export

Godot Version

4.7.2

Question

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?

Where do you expect to see the printout?

Constantly after the notes show up.

I meant where, not when.

What do you mean by “where” here?

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?

In the .console.exe made by Godot when it exports.

There aren’t any errors showing up, and even with _process(), it still doesn’t work

Then are you sure the note is being added? Can you share more of your script spawning the notes? A screenshot of your scene tree may help too

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.

I can see it through the bottom of the screen when I resize the window. SceneTree:

It prints in the spawn code, just not in the movement.