#Problem where game is only receiving text input field from one player

17 messages · Page 1 of 1 (latest)

whole vortex
#

I'm just starting with Mirror and I'm having this problem where only one player can send text via the text input field. The text input fields seems to always accept text from only the last joined to the server.

shrewd drift
#

how are your text input fields instantiated?

#

or are they scene objects?

whole vortex
#

Nope

#

I made sure they were children of the player

shrewd drift
#

that's wrong

#

or you can turn it on only for local player

#

right now what you are doing is every player has an input field,
on every client machine, every player's input field is shown on that machine
you just can't see it but they are overlapping each other. That is why your last player is the one doing the inputs everywhere.

whole vortex
#

So what you're saying is that the input field of the last player spawned overlaps the input field of the ones before?

shrewd drift
#

exactly

whole vortex
#

How do I solve this? only instantiate the input field if it is local player?

shrewd drift
#

you should have it disabled in the prefab and enable it in OnStartLocalPlayer()

whole vortex
#

Ok so disable it like this?

#

And how would I use OnStartLocalPlayer?

#

CanvasObject.SetActive(true); <-- put this inside the function?

shrewd drift
#

yes

whole vortex
#

YOO I got it to work!