Scene not Loading Correctly

Godot Version

4.4

Question

Hey there! There’s been this issue that I can’t seem to find a fix for AT ALL, nor can I begin to guess what may be causing it in the first place. I have a scene, that where a button is pressed, sends you to a second scene, which sends you to the final, third scene. Like a loading screen. When it arrives to the third scene, nothing plays, or moves, or is interactable.

The strange part is I have another completely separate scene that does the same thing. You click a button, it sends you to the same second scene, and then sends you the same third scene. This way works, but there are no code differences that I can find. Thanks a ton, if you can help! Below is the line of code I use to switch to the second scene in both instances.

get_tree().change_scene_to_file("res://Other/loading2.tscn")

Dose it is loading correct if you load it directly without a loading screen?

Tried this. Same issue. The first scene breaks, but the second scene runs perfectly.

How exactly does the first scene break? Are you sure the button pressed event is connected? Is the button getting the input event?

The first scenes bring me to the transition scene as intended, I just assume something in the “corrupted” first scene might be wrong, as only going from there breaks it. The button is connected correctly.

Here’s a small diagram I made, to hopefully help people understand the situation better, cause it’s sorta hard to spell out.

The green path works as intended. Goes from scene 1, to transition scene, to scene 3 without issue. The red path is where it breaks. Goes from different scene 1, to transition scene, and then scene 3, where everything freezes.

What is your third scene? Do you have any global/autoload scripts?

The 3rd scene is a basic menu. It depends on a global script to save its progress. Here’s the script for the menu, and I can post the script for the saving if you’d like. Pardon the mess!

extends Node2D

@onready var office = $office
@onready var locked1 = $locked
@onready var locked2 = $locked
@onready var locked3 = $locked
@onready var locked4 = $locked
@onready var locked5 = $locked
@onready var locked6 = $locked
@onready var voted_file = $voted

@onready var readme = $Sprite2D2
@onready var credits = $Sprite2D4
@onready var voted = $Sprite2D5

var notes 
var loadOffice

# Called when the node enters the scene tree for the first time.
func _ready():
	await get_tree().create_timer(0.1).timeout
	notes = false
	readme.visible = false
	credits.visible = false
	voted.visible = false
	office.visible = false
	Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
	$AnimationPlayer.play("Fade_In")
	
	voted_file.visible = false
	
	#TUTORIAL BEAT
	if MenuConnect.lev1_completed == true:
		locked1.visible = false
		office.visible = true
		voted_file.visible = true
	if MenuConnect.lev1_completed == false:
		locked1.visible = true
		office.visible = false
		voted_file.visible = false
		

func _on_exit_pressed():
	$Click.play()
	get_tree().quit()


func _on_tutorial_pressed():
	$Click.play()
	get_tree().change_scene_to_file("res://Other/loading_tutorial.tscn")


func _on_notes_toggled(toggled_on):
	if toggled_on:
		readme.visible = true
	else:
		readme.visible = false


func _on_timer_timeout():
	MenuConnect.sava_data()


func _on_credits_toggled(toggled_on):
	if toggled_on:
		credits.visible = true
	else:
		credits.visible = false


func _on_notes_pressed():
	$Click.play()


func _on_credits_pressed():
	$Click.play()


func _on_music_finished():
	$Music2.play()


func _on_office_pressed():
	$Click.play()
	get_tree().change_scene_to_file("res://Areas/storage.tscn")


func _on_voted_pressed():
	$Click.play()


func _on_voted_toggled(toggled_on):
	if toggled_on:
		voted.visible = true
	else:
		voted.visible = false

Are you per chance pausing the game using get_tree().paused = true before opening this 3rd scene?

Just checking to be sure.

That was it. Thank you so much! The first scene was paused when I started transferring across the next two scenes, so it must have carried over. Thank you!