Blocked Areas System
UE5 Experience System Version: 1.0The blocked areas system that is included with this asset will let you block off certain areas of your map until the player reaches a certain level in an experience type of your choice. You can set up multiple blocked areas all with different criteria.
This blocked areas system is included to serve as an advanced example of integration into the experience system.
To setup the blocked areas system
There are two parts to this system, first is the player controller component. This component can be found in the Blueprints/Components/ folder, it is called AC_BlockedAreas. Add this component to your player controller (just like you did for the AC_ExperienceSystem component). This component is the part that connects to the experience system. This Blocked Areas component is also what handles the player’s interaction with the blocked areas, the second part of this system.
To add a blocked area
Navigate to the Blueprints/LevelBlockedAreas/ folder and drop an instance of BP_LevelBlockedCube or BP_LevelBlockedRadius into the world. Do not drop copies of the blueprints found in the Client/ subfolder, these are added automatically by the ones in the main folder that you add to the level. The client versions are used for multiplayer support.
After you add one of the two blueprints to your level you can resize it using the scaling tool.
Select the actor you placed in the world. Position, rotate and scale the blueprint using the normal transform tools.
Use the details panel of the actor to set the experience type (name) and required level.
From the selected actor select the teleportPoint mesh and reposition it where you want the player to respawn if they overlap this area without meeting the requirement.
A note about multiplayer games
For multiplayer games select the component you added to your player controller and make sure the isMultiplayer? [bool] is checked. By default it should be. This will use a teleporting mechanism to relocate the players.
Replace the teleport with a solid blocked area in single player game
In single player games you can disable the teleporting if you would prefer the blocked area to actually physically block the player without teleporting them. Select the component you added to your player controller and uncheck the isMultiplayer? [bool].
Replace the teleport with a solid blocked area in multiplayer game
To achieve this you are going to need to add custom channels to your project, then come up with a way to assign these channels to your different blocks. Then you will need to update the player's response to these channels to enable or disable access. You're also limited to 18 custom channels and there is a good chance you will need to use these for other parts of your project. Unfortunately I can not create custom objects or trace channels for your project based on how this asset is packaged which is why the default method of teleporting the player is used. If anyone out there comes up with a better solution for this that can be done entirely in blueprint without changing any project settings please let me know.
Change the appearance of a blocked area
Each blocked area can also use a custom material. By default a red semi transparent material is used. To change the default material, select the actor in the world, then update the MaterialOverride variable on the details panel to the material instance of your choice. I have included a green, blue, and yellow variation of this material instance, and there are a number of other materials that can be found in the Demo/Materials/ folder.
Bypass blocked areas regardless of levels
Use the IgnoreBlockedAreas? event on the AC_BlockedAreas component to toggle ignoring all blocked areas. There is also the IgnoreBlockedAreasFor event which you can use to provide a number of seconds to ignore the blocked areas for, after which the blocked areas will re-enable. To see this in action check out the demo world, it has a button behind the tunnel to Timmy’s Hideout that will bypass all blocked areas for 4 seconds.
A note about projectiles
The blocked areas are also set up to detect and destroy my projectiles if the player's level does not meet the requirement. To adapt this functionality to your game review the event graph of the BP_LevelBlockedRadius blueprint. All other level blocked areas are a child of this one so you only need to make changes here.