Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Help needed in Godot!

A topic by AL3X created Oct 05, 2025 Views: 127 Replies: 2
Viewing posts 1 to 4

Please help me me if you can i am trying to make it so the scene reloads when you hit a trigger but  no matter what  I cant get it to work!

heres my code:


extends Area3D

func _on_body_entered(body: Node3D):

get_tree().change_scene_to_file("res://level.tscn")


The code is attached to an area 3d node because thats what reddit told me to do when it wasn't working the first time.

Please help if you can. i really want this to work

Submitted

Have you tried 

get_tree().reload_current_scene()

To reload the current scene?

Best help I can offer, in the middle of crunching on my own project, best of luck!!

Submitted

idk if this is what you meant but it fully reloads the scene and puts you at the origin-

extends Area3D

func _ready():

body_entered.connect(_on_body_entered)

func _on_body_entered(body: Node3D) -> void:

if body.name == "Player": #characterbody3d name

var current_scene_path = get_tree().current_scene.get_scene_file_path()

if current_scene_path != "":

call_deferred("_reload_scene", current_scene_path)

func _reload_scene(scene_path: String) -> void:

get_tree().change_scene_to_file(scene_path)