Godot Version
4.3
Question
When i call get_tree().reload_current_scene() it works but i am getting this error:
E 0:00:03:0987 get_global_transform: Condition “!is_inside_tree()” is true. Returning: Transform3D()
<Origem C++> scene/3d/node_3d.cpp:345 @ get_global_transform()
this is the function:
func _on_button_2_button_up() → void:
pauser()
get_tree().reload_current_scene()
here is the “pauser” function i am calling before reloading the scene, it basically unpauses the game to grant that the game will not be paused when the game reloads, the same function also pauses and unpauses the game when the user presses the pause button:
func pauser() → void:
if get_parent() and get_parent().has_method(“pre_post_pause”):
get_parent().pre_post_pause()
if is_inside_tree():
get_tree().paused = !visible
visible = get_tree().paused
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE if get_tree().paused else Input.MOUSE_MODE_CAPTURED
if visible and $VBoxContainer/Button.visible:
$VBoxContainer/Button.grab_focus()