what is the device for item_spawner_device ?


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

This tutorial might help

My guess is that you haven’t actually put an item spawner device in the world. That’s why it’s not showing up in the list.

Thank you! I learned granter device from your video. that was great!

and I also found proper device for item_spawner_device.

It was in Fortnite/Devices. I don’t know what is it called in english. but the device was there.

granter looks good too! that will be more customizable option to implement something. thank you.

1 Like