Character doesnt change scene

Godot Version 4.3

I don’t know how to explain it, but in short, during the change of scenes, the character does not change it,
I use the method
get_tree().change_scene_to_file(“some_file”), I added the character to the scenes manually and through a script in the _ready() function,
but still the character was not added to the scene, please help in any way you can, thanks in advance

1 Like

Can you post this code?

@onready var p = preload(“res://scenes/maincharacter.tscn”)

Called when the node enters the scene tree for the first time.

func _ready() → void:
if Global.isEnter == true:
var player = p.instantiate()
add_child(player)
in global script i added “isEnter” for check where is player (it has more meaning)