Verse - How do I check if a referenced device is valid?

I have a custom device in which I added some @editable devices to expose in UEFN. Some of them are mandatory but some are optional, to allow for more freedom in behaviour implementation.

I’m not sure how to check whether an editable device has been specified in UEFN or not. I suppose there must be some sort of IsValid() function inherited from the base device class, but I failed to find it.

Hi Tistik, by optional do you mean you literally defined them as an ‘option’ type?
(as described here: Option)

No, I didn’t know about Option types, but that should do the job! Will give it a try. Thanks!

Hello, i have the exact same issue.

game_manager_device := class(creative_device):

    @editable
    TestDevice: mutator_zone_device= mutator_zone_device{}

    # Runs when the device is started in a running game
    OnBegin<override>()<suspends>:void=
        # Does something with TestDevice if it is set properly

The issue with the code above is, that forgetting to set the TestDevice in the Editor leaves to VerseRuntimeErrors. The is currently no way to check if the editable mutator_zone_device is actually a valid reference.