Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Question Can you animate the caret in text boxes?

Discussion in 'Animation' started by ExpertLuck, Jan 10, 2024.

  1. ExpertLuck

    ExpertLuck

    Joined:
    Mar 14, 2023
    Posts:
    1
    Hello everyone, I'm a total beginner in Unity and this is my first post on this forum, so please be gentle ;)

    Using TextMeshPro, I've created an input textbox and now I'm working on making it look and feel pretty. Then I got the bright idea to make the caret pretty as well. I stopped it from blinking and made an animation that only changes the color of the caret from black, to grey, to white and back again. A gentle tempo that should imitate breathing.

    First, I selected InputField, then, on the Inspector I scroll down to find Input Field Settings, there's the "Caret Color" setting. I opened the animation window and "added keys" on the animator every time I changed the color, with a 2 sec cycle.

    Trouble is, when I hit play, the inspector shows the caret's constantly cycling through the colors, but the caret itself "in game" just stays one color. It only changes color if I turn on to blink interval again. Then, the color changes every time it blinks.

    Is it possible to do it like this, or will I have to animate an object over the invisible caret and connect it to the caret's location? :confused:
     
    Last edited: Jan 10, 2024