Stop Your Bots From Walking Through Walls: AI Navigation Zones
Stop Your Bots From Walking Through Walls: AI Navigation Zones
You’ve built the ultimate fortress. You have turrets, traps, and a moat. But then you spawn your AI guards, and instead of patrolling the perimeter, they try to walk straight through your drywall like it’s made of mist. Or worse, they wander into your lava pit and die immediately, leaving your base defenseless.
It’s not that your bots are stupid; it’s that they don’t know where they can’t go. In Fortnite Creative, AI enemies rely on a "Navigation Mesh" (think of it as an invisible sidewalk map) to decide where to walk. When that map is confusing or too open, your bots get lost or suicidal.
In this tutorial, we’re going to use AI Navigation Modification devices to draw "No-Go Zones" for our enemies. We’ll teach your bots to respect walls, avoid hazards, and stick to the path you designed. No coding required yet, just pure creative chaos control.
What You'll Learn
- The Problem: Why AI bots ignore walls and wander into lava.
- The Solution: How AI Navigation Modification devices act as "force fields" for enemy pathfinding.
- The Build: Setting up a safe patrol zone and a "danger zone" your bots will actively avoid.
- The Logic: Understanding how devices talk to each other to change the map dynamically.
How It Works
Imagine you are playing a game of tag with a friend who has terrible spatial awareness. They might try to run through a locked door or jump off a cliff because they don't realize those things are obstacles.
In Fortnite, AI enemies have the same problem. They see the world as a flat plane of "walkable" space unless you tell them otherwise. The Navigation Mesh is the invisible grid that says, "You can walk here." But sometimes, that grid is wrong. Maybe you built a complex stair case, and the bot thinks it can just fly up the side of it.
Enter the AI Navigation Modification device.
Think of this device as a "Do Not Enter" sign made of pure magic. When you place this device in your island, it creates a 3D bubble (a volume). Any AI enemy that tries to pathfind into that bubble will be told, "Hey, you can't go there, that’s illegal."
You can use this to:
- Protect your bots: Keep them out of your own traps or lava so they don’t die before they can help you.
- Control the flow: Force enemies to take a specific route by blocking off the shortcuts.
- Dynamic changes: Turn these zones on and off. Maybe the "No-Go Zone" is actually a secret passage that opens up later in the game?
It’s not about stopping the bot after it hits the wall; it’s about convincing the bot’s brain that the wall doesn’t exist in the first place.
Let's Build It
We are going to build a simple "Guard Post." We’ll spawn a guard, give them a patrol path, and then use an AI Navigation Modification device to ensure they don’t walk into the ceiling or out of the room.
Step 1: The Setup
- Open your island in UEFN.
- Place a Guard Spawner device.
- Place an AI Patrol Path Node device nearby. Use your phone tool to add a few more nodes to create a small loop (a square works best). This is where your guard will walk.
- Test it: Play your island. Watch the guard. If they are walking through walls or floating, that’s what we’re fixing.
Step 2: Adding the "No-Go" Zone
- Go to your Creative Inventory.
- Search for AI Navigation Modification.
- Place it in the editor. You’ll see a large, semi-transparent cube.
- Resize this cube so it covers the "impossible" areas. For example, if your guard is trying to walk through the ceiling, make the cube cover the ceiling space. If they are trying to walk out of the room, make the cube cover the exit door.
Step 3: The Verse Code (Connecting the Dots)
While the device works by default, let’s make it cooler. We’ll write a tiny bit of Verse to toggle the navigation zone. Imagine this: The guard is safe inside the base. But when the "Storm" starts, we want to open up a new area for them to defend. We’ll use Verse to turn the "No-Go" zone off when the storm hits, allowing the bot to move freely into the new zone.
Here is the code. Don’t panic, it’s just telling the device when to be active.
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
# This is our Device. It's the physical object in the world.
# 'NavigationZone' is just a name we give to this specific device instance.
# It's like naming a specific trap "The Spicy Trap."
NavigationZone := class(creative_device):
# This is an 'Event'. In game terms, an event is something that HAPPENS.
# Like a player getting eliminated or a storm starting.
# 'OnBegin' is the event that fires when the island starts playing.
OnBegin<override>()<suspends>:void=
# 'Print' is like shouting into the sky. It shows text in the debug menu.
# We use this to know our script is working.
Print("Guard Zone Active: Bots cannot enter the ceiling!")
# Here we interact with the device's properties.
# 'Is_Active' is a boolean (true/false switch).
# We set it to true, meaning the "No-Go" force field is ON.
# If we set it to false, the force field disappears, and bots can walk there.
# self.Is_Active = true```
### Walkthrough of the Code
1. **`class(creative_device)`**: This tells Verse, "I am making a script that belongs to a Creative Device." It’s like saying, "I am building a trap, not a weapon."
2. **`OnBegin()`**: This is the **Start of Game** event. Just like the match starts when the bus lands, this code runs when you hit "Play." It turns our navigation zone on immediately.
3. **`self.Is_Active`**: This is a **Variable**. A variable is a container that holds a value that can change. Here, the value is `true` or `false`. `true` means the zone is active (banned area). `false` means the zone is inactive (open area).
4. **`Print(...)`**: This is for debugging. It’s your **Squad Chat**. It lets you know what the code is thinking. If you don’t see this text in the debug menu, your code isn’t running.
## Try It Yourself
Now that you have the basics, try this challenge:
**The "Lava Moat" Challenge:**
1. Create a small room with a Guard Spawner.
2. Surround the room with **Lava Tiles** (or a hazard zone).
3. Place an **AI Navigation Modification** device.
4. Resize the device to cover the lava tiles completely.
5. **The Twist:** Add a second device, a **Timer Device**. Set it to "On Timeout" trigger the AI Navigation device to turn **OFF**.
6. Play the game. The guard should stay safe in the room for 10 seconds, then the "No-Go" zone disappears, and the guard should walk into the lava and die.
**Hint:** You need to link the Timer Device’s "On Timeout" output to the AI Navigation Modification device’s "Disable" input. Check the device options on the AI Navigation device to see if it has a "Disable" input slot, or use Verse to toggle `self.Is_Active = false` when the timer ends.
## Recap
* **AI Navigation Modification** devices create "invisible walls" that tell AI enemies where they *cannot* go.
* Use them to keep bots out of hazards, off ceilings, and on your intended path.
* You can control these zones dynamically using **Events** (like timers or player deaths) and **Variables** (like `Is_Active`) in Verse.
* Your bots aren’t dumb; they just need you to draw the map correctly.
## References
* https://dev.epicgames.com/documentation/en-us/fortnite/using-ai-navigation-modification-devices-in-fortnite-creative
* https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-ai-navigation-modification-devices-in-fortnite-creative
* https://dev.epicgames.com/documentation/fortnite/verse-starter-03-designing-levels-for-in-unreal-editor-for-fortnite
* https://dev.epicgames.com/documentation/en-us/fortnite/using-ai-patrol-path-node-devices-in-fortnite-creative
* https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-ai-patrol-path-node-devices-in-fortnite-creative
Verse source files
- 01-device.verse · device
Turn this into a guided course
Add using-ai-navigation-modification-devices-in-fortnite-creative to your free study plan — we'll suggest related pages and stitch the lot into one compile-checked, self-guided lesson with worked examples and quizzes.
References
- using-ai-navigation-modification-devices-in-fortnite-creative ↗
- using-ai-navigation-modification-devices-in-fortnite-creative ↗
- verse-starter-03-designing-levels-for-in-unreal-editor-for-fortnite ↗
- using-ai-patrol-path-node-devices-in-fortnite-creative ↗
- using-ai-patrol-path-node-devices-in-fortnite-creative ↗
Original tutorial generated by Verse Island from the Verse/UEFN knowledge base, with references to the Epic Games sources above. Code is validated against the knowledge base.