Build Your Own Sentry Bot Defender
Build Your Own Sentry Bot Defender
Imagine a tiny robot guard standing in your island. It watches for players. If they get too close, it shoots! You can build this with just one device. Let’s make your first AI defender.
What You'll Learn
- How to find the Sentry device in UEFN.
- How to set its health and weapons.
- How to place it so it protects your base.
How It Works
A Sentry device is like a security camera with a laser pointer. It sits in one spot. It waits for players to enter its view. When a player enters, the Sentry wakes up. It shoots at the player until the player leaves or the Sentry breaks.
Think of it like a toy robot dog. You set it down. You give it batteries (health). You tell it to bark at strangers (attack players). It does this job all by itself. You don’t need to code anything to make it move. It is ready to play right away.
You can change what it looks like. You can change how strong it is. You can even give it different guns. This makes every island unique.
Let's Build It
We will build a simple guard tower. The Sentry will protect the door to your house.
Step 1: Find the Sentry
Open your Creative Inventory. Click the Devices tab. Search for "Sentry". Drag it onto your island. Place it near a door or a corner.
Step 2: Arm the Sentry
Click the Sentry device you placed. Look at the Options panel on the right.
- Health: Set this to 500. This is like a health bar. It is how many hits it can take.
- Weapon: Choose a gun from the list. A pistol is good for beginners.
Step 3: Test It
Press Play. Walk up to the Sentry. Watch it turn toward you. It will start shooting. Run away! It stops shooting when you are far away.
Here is a simple Verse script to customize a Sentry’s name and health. This helps you remember which Sentry is which.
# This script creates a named Sentry with custom health
# We use a "Device" to link to the Sentry object in the world
sentry_device : Device = Device{}
# This function runs when the game starts
OnBegin<override>()<suspends>: void =>
# Find the Sentry device by its name in the editor
# We assume you named the device "MyGuard" in UEFN
guard := GetDevice("MyGuard")
# Check if we found the device
if (guard != nil):
# Set the health of the Sentry
# 1000 is a strong health value
guard.SetHealth(1000)
# Print a message to the console
# This helps you know the script worked
Print("MyGuard is now super strong!")
What does this code do?
Device: This is a link to a device on your island.OnBegin: This runs when the game starts.GetDevice: This finds the specific Sentry you named.SetHealth: This changes how much damage it can take.
Try It Yourself
Can you make two Sentries? Place one near the front door. Place one near the back door. Change their health. Make one weak (100 health). Make one strong (1000 health). Play your island and see which one lasts longer.
Hint: You can rename devices in the World Outliner. This makes them easier to find in your code.
Recap
Sentries are easy AI guards. You place them. You give them guns. They watch for players. You can customize their health and weapons. They add fun challenges to your island.
References
- https://dev.epicgames.com/documentation/en-us/fortnite/using-sentry-devices-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/random-sentry-fight-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite/using-devices-in-fortnite
- https://dev.epicgames.com/documentation/en-us/uefn/escape-room-9-inside-cabin-in-unreal-editor-for-fortnite
- https://dev.epicgames.com/documentation/en-us/fortnite/random-sentry-fight-in-fortnite-creative
Verse source files
- 01-fragment.verse · fragment
Turn this into a guided course
Add using-sentry-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
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.