Godot behaves strangely with @export variables. I do not know why this is happening

Godot Version

<4.2>

Question

<Hi, I have the @export certain room link reset when switching to a new scene, but it shouldn’t work like this :

rather than you assign like this with @export and PackedScene type
image
change to :

@export var certain_room:String= ""

then in
image
change to:

func player_enter():
	if certain_room!="":
		var certain_room_scene= load(certain_room)
		get_tree().change_scene_to_packed(certain_room_scene)

then in you inspector dock, you just type the address of the scene you want to build in the certain_room property

2 Likes

Phew, a big thank you. You are the first from > 300 people, who could solve this problem.

1 Like