Search Unity

GUI and FirstPersonControllers???

Discussion in 'UGUI & TextMesh Pro' started by mikelowefedex, Dec 2, 2020.

  1. mikelowefedex

    mikelowefedex

    Joined:
    Sep 29, 2020
    Posts:
    139
    Hello,
    I was able to design a GUI system where if the player has his crosshair on a character and clicks the left mouse button, 4 GUI controls from the canvas are set to active (A text of what the character says, a text that says, "Type what you want to say.", an edit control under it that allows text to be entered and a button under that that says, "Submit"). I also had to set the cursor's lockstate to None before I could interact with the GUI controls, because pressing escape and clicking the edit control relocks the mouse cursor.

    The problem begins when I have the edit control selected and start typing text in the edit control. The W, A, S, D and space bar STILL controls the character WHILE I am entering data into the edit control. One way I figured to stop this from happening, is to stop those keys from being active IF a GUI control is active and selected. How can I determine the current focus of a GUI control? Thank you.