How to Enable Two Random Character Devices at Game Start in Verse?


Hi everyone,

I’m working on a Verse project in UEFN and I’m running into a problem with activating character devices.

My setup:

  • I have 5 character devices (all hidden at the start).
  • I want to enable (activate/show) 2 of them randomly as soon as the game starts.
  • I tried creating a function to do this, but I’ve realized I can’t call a decides function directly inside OnBegin (it gives an error or just doesn’t work).

My problem:
I understand that you can’t use decides directly in OnBegin, but I haven’t found a good workaround.
Is there any clean solution or alternative way to do this? For example, is there a way to schedule the function for just a second later, or is there another method to enable devices on game start that works reliably?

It’s a bit frustrating because this seems like a basic use case! Any help or code examples would be greatly appreciated.

Thank you!

Try putting this on OnBegin

ShuffledCharacterDevices:=Shuffle(CharacterDevices)
if(CharDevice1:=ShuffledCharacterDevices[0]):
     CharDevice1.Enable()
if(CharDevice2:=ShuffledCharacterDevices[1]):
    CharDevice2.Enable()
1 Like

(post deleted by author)

Hi, it’s working thank you!!

Now I’m working in UEFN using Verse, and I have two NPC characters placed in the world. I want to help players find these characters by showing an arrow above the player (or a map marker) that points towards the position of each NPC.

What’s the best way to display an indicator that dynamically points to a specific character’s location?
Are there any built-in functions or devices for this in Verse?
If the target NPC changes, how can I update the arrow or marker accordingly?

Any code snippets or links to documentation would be greatly appreciated.
Thank you for your help!