Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Let us know a bit about your interests, and if you'd like to become more directly involved. Take our survey!
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Unity UI What is the best way to go about returning the word clicked, from a single UI text?

Discussion in 'Unity UI & TextMesh Pro' started by joelybahh, May 16, 2018.

  1. joelybahh

    joelybahh

    Joined:
    Mar 18, 2015
    Posts:
    2
    The reason I am asking this is I have some voice to text implemented, and it returns the string for what was said quite reliably.
    However, If the user says a big sentence and realizes one word was misinterpreted, they currently have to start again and say that whole phrase over again, resulting in another chance of mis-interpretation.

    Ideally the user will click the word they see as misinterpreted, and just re-say that word.

    I have considered splitting the string by the space character, instantiating buttons with no background, and then placing/spacing them to be restructured back into a sentence of clickable text buttons, which sounds a bit messy.

    Things to consider:
    • This is on a worldspace canvas.
    • The UI interactions are triggered by the user pointing the vr controller at the panel.
    • The standard unity hover, click and unhover events are still called as normal, just on a worldspace panel with VR.

    Has anyone ever done anything like this in the past who can assist?

    Regards,
    Joel - InspaceXR
     
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    8,356
    Sorry no one replied to this yet. If you can switch to TextMesh Pro, you can check which word was clicked with a single function, as described in this video:


    This blog post has some code examples that might help, too: https://deltadreamgames.com/2018/01/