Hello everyone I have a question about the level transition. For example, I have Two Levels, in the first level,I created a Box collusion, when the character enters this collusion, it is teleported to the second level with the “Open level” function. Then, in the blueprint of my character, GetSword? and HasKey ? I created the booleans. When the character takes the sword, GetSword becomes true and attaches to the character’s hand. HasKey again when retrieving the key? turns into true. There is also a branch on the door that I want to open in Level 2, and I created a bluprint of “If HasKey? If True, Open the Door”. Normally, if the door and the key are in the same level, the door opens, but if I get the key in the first level, when I teleport to the second level, I cannot open the door, because the game acts as if I never took the key in the second level. Likewise, the sword I take in the first level disappears at the second level and it is like it was never attached to my hand. How can I solve this? , I’m new to UE5, I would appreciate it if you could explain it in detail. Thank you
Hey @SuppleWaif7
when you load a new level your variables will be set to their default value. You need to use a SaveGame or use a GameInstance
1 Like
I am little bit confused, my key blueprint is like this:
And this is my door blueprint:
An my character’s blueprint has Has Key ? boolen.
I created an instance file, created boolean variable which is call GotKey? then I change all Haskey variable wtih GotKey? but gettin error.
Okay, I create a game instance and create my boolean which is HasKey?:
Then I go to project setting → maps& modes and select the game instance which I was created:
Then I go to my Key Blueprint and delete old HasKey boolean which was created in Character BP. Put Get Instance, then cast to my gameinstance after that I call the new Haskey? boolean from this game instace:
I did same thing for door BP too:
This white Cone is my Key item, I took from LVL 1 here:
Then I teleport to LVL 2 and open the door:
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.