TextField on lose focus

Hi all!

Currently,I have a third person controller using the supermario script from Unity3D website. At the same time, I have a chat box. Let’s say when I’m typing halfway in my textfield and I click elsewhere in my scene, I’m not able to control my character. I would have to clear the text in my textfield and click elsewhere to control my character.

My question is, is there any way to control my character without clearing the text in the textfield?

Thanks in advance!

Hi, welcome to the forum!

You can use GUI.FocusControl to move the focus from the textbox to, say, a button or other control that doesn’t accept text input.

Hi!

I’ve tried this method before and setting keyboardControl to 0. But it doesn’t allow me to control my character.

Would it be possible to swap the textfield for a label when gameplay resumes after a chat?