Search Unity

Question GUI.TextField set carot position

Discussion in 'Immediate Mode GUI (IMGUI)' started by TheRealGrendel, Nov 23, 2021.

  1. TheRealGrendel

    TheRealGrendel

    Joined:
    Jun 17, 2016
    Posts:
    16
    Hello! I'm currently writing a command line style cheat system and I'm using GUI.TextField as the input field. I'm running into an issue where if I set the value of the text in code the carot doesn't move to the end of the line. To clarify, I could be typing "dia", have the cheat hint system complete the line to "dialogue", but the carot stays after the "a" still ("dia|logue"). I know InputFields exist but I don't want to be using UI elements in something that is pure GUI.

    Open to any suggestions!