Hey all. I’ve been trying to research this for a long time and I struggle with coding and blueprints. I’m creating an open world coop game for my kids and I want some of the buildings to be enterable but I feel having them in a separate map/level will help keep things less resource heavy. How am I able to have a seperate map load when interacting with a door and have both players able to enter and exit and interact together in both the persistent level and sublevel. I am still using UE4.27. Will switch to 5 if needed.
To create a separate map that can be loaded when a player interacts with a door in the persistent level, you can use the Level Streaming feature in Unreal Engine. With Level Streaming, you can load and unload levels on demand, allowing you to keep your game world more efficient and organized.
It can be achived someway like this:
- Create a new level that contains the interior of the building you want players to enter.
- Add a trigger volume or door mesh to the persistent level that the player can interact with to load the sub-level.
- Add a level streaming volume to the persistent level. This volume will be responsible for managing the loading and unloading of levels based on the player’s position.
- In the level streaming volume, add the new level you created to the list of levels that can be loaded. You can set this level to be unloaded by default, so it won’t be loaded until the player interacts with the door.
- When the player interacts with the door or trigger volume, use a blueprint or code to load the sub-level. You can use the Load Stream Level node to do this.
- Once the sub-level is loaded, the players will be able to enter and interact with the interior of the building. When they leave the building, use a similar blueprint or code to unload the sub-level using the Unload Stream Level node.
- To ensure that both players can interact with the sub-level, you can set the level to be loaded on the server side, and make sure that all players are in sync when loading and unloading the level.
This should be fully achievable on the 4.27 version that you are currently using.