I’ve been following the tutorial as I get started with verse, I’ve bad a button that’s supposed to spawn and item. The code, taken from the tutorial is this:
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(creative_device):
@editable
Button:button_device = button_device{}
@editable
ItemSpawner:item_spawner_device = item_spawner_device{}
OnBegin<override>()<suspends> : void =
Print("Verse Code Started")
Button.InteractedWithEvent.Subscribe(OnButtonInteractedWith)
OnButtonInteractedWith(InPlayer:agent) : void =
Print("Button pressed")
ItemSpawner.SpawnItem()
Print("Cancelled this InteractedWithEvent")
As you can see when the button is interacted with a message is printed to say it was prssed and then the SpawnItem function is called. The problem is, it doesn’t do anything, I can see that the printed messages are met but nothing ever spawns
ON my hello_world_device I have ensured that both the button and the spawnitem devices are selected in the variables ( I even doubled down on this by selecting them with the dropper just to be sure ).
Am I missing a really simple piece of the puzzle here?
I had not selected an item to spawn specifically, I had set it to random assuming that would be enough. I defined a shotgun just now for testing and that’s it working now. Such a simple thing and it wasn’t in the documentation. Thanks @GraemeBB
Glad to see this will be fixed soon, recently checked out this tutorial and ran into the same issue, since the documentation only says to drop the spawner in and not specify any items to spawn.
I had this same question about the tutorial. The Verse code is correct, so I had to made some settings in the UEFN “Details” about the “Item Spawner” device:
User Options → Unmark the “Spawn Item on Timer” and “Respawn Item on Timer”
User options → Item List → Add an item in the “Array Element”