- Home /
Level Segmenting and Loading
I want to have levels where when you hit a trigger volume the next segment of the level loads. Like in halo 3's checkpoints. You enter a trigger volume, the next segment loads, and if there is a door that you pass through soon after the trigger volume. that door locks preventing you from returning to the previous level segment. How do i do this?
Answer by tnetennba · May 08, 2012 at 01:57 PM
When you enter the trigger you can get this message on a monobehaviour script:
http://unity3d.com/support/documentation/ScriptReference/MonoBehaviour.OnTriggerEnter.html
In this function you can then call to loads the next part of the level additively:
http://unity3d.com/support/documentation/ScriptReference/Application.LoadLevelAdditiveAsync.html
Once this has completed you can then play an animation on the door to allow it to open. Once the player has passed through you can then use another trigger to say that the player has passed through the door and to close it. This would then prevent the player from back tracking.
Your answer
Follow this Question
Related Questions
Loading a New Level 1 Answer
Level Fade Help! 2 Answers
Any way to load a "map" without it being a built scene? 1 Answer
How to check trigger overlap area? (with Image) 1 Answer
How should you make an MMORPG world? 3 Answers