This may be trivial but I would like some input on it.
What would be the best way to transfer player data between scenes? For example, I have a player in scene 1 that picks up a potion and adds it to his inventory and then eats an apple so his hunger decreases to 0. He then enters a portal and scene 2 loads. In scene 2, the player still has a potion in his inventory and his hunger is at 0.
Any ideas / tips / help is greatly appreciated.
Thanks
Don’t destroy the player & inventory when you load another scene?
1 Like
You need to make a don’t destroy on load script and it will persist between all scenes. Add this script to an empty GameObject called GameManager preferably.
using UnityEngine;
using System.Collections;
public class DontDestroy : MonoBehaviour {
void Start(){
DontDestroyOnLoad (gameObject);
}
}
1 Like
Ah I see, thanks for the help 
Not the only option. Another way is to start thinking about scenes as collections of game objects. Load the scenes additively and destroy specific game objects when done with them.
e.g.
Load main scene (system game objects)
Load player scene (additive)
Load level 1 scene(additive)
Destroy level 1 objects
Load level 2 scene(additive)
1 Like