Godot Version
4.2.2.stable
Question
My scenes arenāt transitioning. I need help. Iām tired and I donāt know what Iām doing wrong. This is the first code:
extends Control
@export var next_scene = āres://GameScenes/InitialStory.tscnā
var load_progress = 0
var max_progress = 100
func _ready():
$LoadingTimer.start()
func _process(delta):
if load_progress < max_progress:
load_progress += delta * 20 # Adjust speed as needed
$LoadingBar.value = load_progress
else:
$LoadingBar.value = max_progress
func _on_LoadingTimer_timeout():
if load_progress >= max_progress:
get_tree().change_scene(next_scene)
In this code, I just want the Scene to go to the InitialStory scene after the Loading Bar reaches Max. Thatās all but itās not working and itās just killing me.
This is second code:
extends Control
@export var tutorial_scene = āres://GameScenes/Tutorial.tscnā
func _ready():
# Connect the buttonās pressed signal to the function
$NextButton.connect(āpressedā, self, ā_on_NextButton_pressedā)
func _on_NextButton_pressed():
# Load the tutorial scene
get_tree().change_scene(tutorial_scene)
This one isnāt working either please help. My game needs Scene changes to fundamentally work.