Hey all,
I’m working on a platformer and I have one scene which is supposed to be like open world and a small building with a door that’s supposed to be a shop building. I’d like when player gets to the door and press UP to be able to spawn in the new scene called house.unity. I tried several ways and read around dozen of websites/answers to the similar issue but couldn’t find a complete answer
There are two main issues: a) I want to keep the player, for example even tho player starts first as a prefab, once the user is playing the game, player is supposed to gather weapons and those show up on the character as well… Simply instantiating a basic player prefab in a store is a big no-no… + I want to keep player’s score, money, attributes etc…
b) I want to keep track of x/y coordinates of door entrance, so when I later want to exit the shop I’ll be spawned just outside it…
Now I read A LOT about PlayerPrefs, DontDestroyOnLoad, OnLevelWasLoaded or even using a static variables but still find it hard to find the best or working way
So the scenario is:
-Player is spawned into a world at a start of a new game by simply instantiating player prefab at designated spot.
-Camera isn’t father/child of player, it’s another GameObject floating in hierarchy that follows player via code.
I have a world and a door. Door has a trigger and is supposed to enable loading of level “house_01.unity”.
The “house_01.unity” contains scene with merchant and a door. Does this scene needs another camera? a spawn point?
How can I TAKE my player, totally cut and paste it at “house_01.unity” at lets say empty gameobject with name “spawnMeHere” and also move a camera into that scene as well?
It might looks like I’m lazy and I want YOU to do the work instead of me, but I spent a good 3-4hrs just looking for solution and I’m not getting it
Thanks all