- Home /
How do I enter and exit buildings?
(FOLLOWING UP: I FOUND AN ANSWER TO THIS QUESTION. if you have any questions on the topic I should be able to help)
Ideally I would like to use the multi-scene way of doing it. By loading a new scene once I open the door and reloading the previous scene when I exit the door. However whenever I leave said door the script I used reloads the level from the beginning. Any help??? I want at Skyrim/GTA style way of entering and exiting places in the means that when you exit the building you are at the door.
You're really asking two questions:
First, how do you pick a spawn point for the player? Usually you'll need some information in the scene. $$anonymous$$aybe a custom component, tag, or name that you attach to spawns. As a scene is loaded, you can then reference that information to move the player to their new spawn point. You can probably find tutorials to help with this.
Second, how do you pass information between scenes? The two simplest ways are to use static objects, or objects which aren't destroyed during scene transitions. You can probably find tutorials to help with this.
Either way, you're going to need some code support for this feature.
Answer by getyour411 · Feb 04, 2014 at 02:09 AM
As @rutter indicates, you need to read on DontDestroyOnLoad, Application.Loadlevel and static
Just wanted to follow up. Thanks. I figured it out by doing exactly what you both said. Appreciate the help!
Good deal, if you feel the Answer helped, please mark it answered/closed.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Animation spins wildly after completed 0 Answers
hide object start script 4 Answers
Flashlight Blink? 1 Answer