Hello everyone, i need help, I’m making a Side Scrooler game and in it you have to collect 3 coins (2 are in the first level and the last one in level 2) to buy an item that and a key (that will be used in level 2) . However, everytime I collect the coin and the key on level 1 and then go to level 2 all the items are gone.
How do I fix this?
You need to use a game instance blueprint.
The game instance and any of it’s derived classes are the only classes that persist between levels. The only other way to persist data between levels is to save the data in a database or file and load it in the next level.
I always recommend making a post-it of the following to people:
Game instance: Persistent, not-replicated (Each client and server have their own game instance)
Game mode: Non persistent, Server only
Game state: Non persistent, replicated (A change on a client or server is replicated to other clients and the server)