Search Unity

  1. Unity 2018.3 is now released.
    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. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    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:
    4
    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,768
    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/