# We need access to Verse's core tools
using { /Verse.org/Simulation }
using { /Verse.org/Native }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/SpatialMath }
using { /Fortnite.com/Devices }
using { /Fortnite.com/Game }
using { /Fortnite.com/Characters }
# This is our main script, implemented as a creative_device
# so it can be placed directly on your UEFN island.
castle_builder := class(creative_device):
# CONSTANT: The radius of our castle.
# Like setting the storm size once in the editor, this never changes.
CastleRadius : float = 1000.0
# VARIABLE: Tracks if the gate is open.
# Like a health bar, this changes during the game.
var GateIsOpen : logic = false
# Reference to a trigger device placed in the editor.
# Wire your "castle entrance" trigger_device to this in the UEFN
# outliner so the device knows which trigger to listen to.
@editable
EntranceTrigger : trigger_device = trigger_device{}
# EVENT: This runs when the island starts.
# Think of this as the "Start of Match" button.
OnBegin<override>()<suspends> : void =
Verse Library
verse
01 Device
Generates castle walls and manages gate states automatically when players enter a mapped zone.
verse-library/using-castle-prefabs-in-fortnite-creative/01-device.verse
Sign in free to read the full source 🌴
This Verse Library file is members-only. Create a free account to view the complete source and download the .verse file.