<aside> <img src="/icons/reorder_gray.svg" alt="/icons/reorder_gray.svg" width="40px" />
Navigation
</aside>
Obstacles are objects located directly inside the gameplay field, to limit movement and create hiding spots.
Select the prefab you’d like to turn into an obstacle.
If the object doesn’t have any kind of collider please add any of the next colliders:
Adjust its parameters so it approximately covers the shape.
In the Inspector window, change the object’s layer to Obstacle for each object you’ve put a collider on (or if there was a collider before).
This will allow the physics engine to calculate bullet collisions and prevent aiming through the obstacles.
Add NavMeshModifier and NavMeshObstacle components. Adjust NavMeshObstacles’s parameters so it tightly fit the object shape. These 2 components are responsible for object and player collision (not allowing the player or NPC to go through).
For clarity existing obstacles for each world are stored in dedicated folders.
Each obstacle needs to be registered in the Level Editor. This will allow quick spawn of it during level creation and is a key part of the game's quick loading system.
Right-click on the prefab and select Add into Level Editor
Set 2 required fields and click Add
.
If you forgot something in the previous step, you will get an error message.
Done. A new prefab can be used during level creation.
You can see the entire list of obstacles and environment elements in the Level Editor → World Settings
tab.
This list can be modified, so you can add, remove, or edit existing items.