How do i keep a variable when my character dies?

I have a basic key and door where if the player has a key they will be able to open the door, however if the player dies they lose the variable allowing them to open the door. Meaning if a player dies during the level they are unable to complete this, how do i make it so the player doesn’t lose the variable? Thanks.


(Key blueprint)


(Door blueprint)

Variables that should persist beyond the life of the character should be saved on the PlayerState or PlayerController instead.

I’m trying to do this however i haven’t been able to get it to work, could you show/explain how i should be trying to fix this problem? Thanks.

After trying and failing i decided to make the key variable an integer in the gamemode, similar to my collectable and it worked.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.