- Home /
in-game chat woe...
I have an in-game chat in my game. When you press T it shows the text field. Two main problems, ONE because of cursor lock, the game must be paused to type. TWO you cant send by pressing enter if the textfield is in focus.. how can I work around this?
Are you saying you want the game to pause while typing? Because it doesn't by default.
I want to be able to type without having to click in the textfield, and also send without exiting the focus of the text field.
Answer by Dave-Carlile · Nov 21, 2012 at 04:56 PM
For the "press enter to send" part of your question, refer to this discussion: http://forum.unity3d.com/threads/69361-GUI.TextField-submission-via-quot-return-quot-key...
Basically, you need to check the keypresses and look for the return key.
For the "pause to type" part - the game will not pause while using the text field. Can't tell from the question if you want it to pause or not.
Ignoring the "pause" word, the problem is really just cursor lock. The text field does not come in focus unless I click it, however I cannot click it unless I unlock the cursor by opening my pause menu.
How can I allow the textfield to let me type without having to click inside of it?
Answer by XienDev · Nov 21, 2012 at 05:04 PM
for the second part of your question, just draw cursor when textfield is opened =)
Answer by In-D Gaming · Nov 22, 2012 at 10:08 AM
OK, my problem is fixed. I looked into Dave's link and fixed that issue, and somehow the other one is fixed too. Thanks!
Your answer
![](https://koobas.hobune.stream/wayback/20220613084251im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Can you have a scrollview inside a textfield? 0 Answers
Building a Message Board 0 Answers
Text fields where text will scale along with resolution. 1 Answer
Clear gui Text field 1 Answer
GUI custom textfield cursor rendering 2 Answers