cancel
Showing results for 
Search instead for 
Did you mean: 

Custom UI unfocus

KevinJardine
Member

Is there any way to unfocus a Custom UI using a script so the player does not have to do it themselves? I have a series of UI interactions and after they are over, I want to return the player to the main environment.

1 ACCEPTED SOLUTION

Accepted Solutions

KevinJardine
Member

I got a response to this question on the Discord server and verified it works. And it is easy.

There is a player.unfocusUI() function.

So in my UI code I do something like:

return Pressable({
  onPress: (player: Player) => {    
    this.async.setTimeout(() => {player.unfocusUI()}, 3000);
}
});
 
This enables me to display a response screen for 3 seconds and then I unfocus the Custom UI. 

View solution in original post

1 REPLY 1

KevinJardine
Member

I got a response to this question on the Discord server and verified it works. And it is easy.

There is a player.unfocusUI() function.

So in my UI code I do something like:

return Pressable({
  onPress: (player: Player) => {    
    this.async.setTimeout(() => {player.unfocusUI()}, 3000);
}
});
 
This enables me to display a response screen for 3 seconds and then I unfocus the Custom UI.