Switch inputs when focusing on UI or on 3D scene in multiplayer

Hi all,

I would like to know what is the best approach to respond to keyboard inputs when I am hovering on 2D UI without interfering with locomotion of my 3D character and vis and versa?

For exemple, I want to add the PUN Chat somewhere and when I pass through the chat I want to be able to fill text without taking keys into account in the scene. And when I exit this chat zone, I come back on the normal behavior.

As I am in multiplayers context, I wonder if something already exists or if I need to treat this by myself and then what are your preconisations?

Thank you for your help

BR.
 
Last edited:
Yes I read this part of the documentation but I don't know how to assign m_character in Pun Multiplayer context. I mean it should be the clone then assign in runtime or I misunderstand something ?
 
There are a few different ways you can get the local player but one way would be to use the CameraController's Character reference. This will always be pointed to the local player. Any UI element will also point to the local character. You could also create a new class which keeps track of the local player based off of the OnPlayerEnteredRoom event.
 
Top