I want to have a reference to a device exposed to the editor so that other devs can assign devices as necessary, however, I want my code to be able to handle cases where the reference to a device is not set. Unfortunately, if you mark something as editable, it can’t also be an option type, so is there another way I can go about checking if a reference is null?
My current workaround is to have the reference be an array, and I’m only taking the first index of the array and checking if that’s valid.
Being unable to have an option type with the editable attribute as a field within a concrete class, and therefore, being unable to evaluate whether a value has been set beyond the default initialisation, does seem like a significant limitation/oversight. For example, imagine a scenario where a timer device is required as a trigger for critical gameplay logic (such as disabling barriers, spawning enemies, etc.). If the reference to the timer device is unset, it silently fails (which I’d argue is worse than an exception being thrown). I’ve submitted a bug report, so fingers crossed that Epic will address and resolve this in future revisions.