# This is our Fishing Zone device using { /Fortnite.com/Devices } using { /Verse.org/Simulation } using { /UnrealEngine.com/Temporary/Diagnostics } # We name our device "FishingZoneDevice" FishingZoneDevice := class(creative_device): # We add an item_spawner_device to give items to the player # Place and link an Item Spawner device in your island, # then bind it to this property in the Details panel @editable ItemSpawner : item_spawner_device = item_spawner_device{} # We add a mutator_zone_device so we can detect players entering # Place and link a Mutator Zone device in your island, # then bind it to this property in the Details panel @editable FishingZone : mutator_zone_device = mutator_zone_device{} # This runs when the game starts OnBegin() : void = # We tell the zone to watch for players # "AgentEntersEvent" fires when a player steps inside FishingZone.AgentEntersEvent.Subscribe(OnPlayerEnterZone) # This function runs when a player enters OnPlayerEnterZone(Agent : agent) : void = # We spawn the fishing rod through the Item Spawner device # The Item Spawner is configured in the editor to hold the rod # note: Verse has no direct runtime item-creation API; item_spawner_device is the standard approach ItemSpawner.SpawnItem() # We print a message to the screen # This helps us see the code working Print("You caught a rod!")