using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
# See https://dev.epicgames.com/documentation/en-us/uefn/create-your-own-device-in-verse for how to create a verse device.
# A Verse-authored creative device that can be placed in a level
hello_world_device := class<concrete>(creative_device):
@editable
numA : int = 0
@editable
Button:button_device = button_device{}
@editable
ItemSpawner:item_spawner_device = item_spawner_device {}
# Runs when the device is started in a running game
OnBegin<override>()<suspends>:void=
# TODO: Replace this with your code
Print("Hello, world!")
Print("numA + numA = {numA + numA}")
Button.InteractedWithEvent.Subscribe(OnButtonInteractedWith)
OnButtonInteractedWith(a:agent):void =
Print("SPAWN")
ItemSpawner.SpawnItem()
Hello!
I used this code and compiled it. I also placed item spawner device into the world. The item spawner I used is in Fortnite/Consumables/Gold
.
but, I can’t find the device to assign in ItemSpawner
.
what is the proper device to assign in ItemSpawner
?
I followed this tutroal
https://dev.epicgames.com/documentation/en-us/uefn/coding-device-interactions-in-verse