Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Word Click Events

Discussion in 'UGUI & TextMesh Pro' started by zapman502, Oct 26, 2021.

  1. zapman502

    zapman502

    Joined:
    Apr 13, 2020
    Posts:
    14
    If this was already discussed somewhere please link the source.

    I saw another thread with a similar title as to what I wanted to achieve but the discussion was different.
    I want to make a Dialogue system like the one in the video game The Elder Scrolls: Morrowind, where certain words of interest are highlighted in an NPC's dialogue and can be clicked to discuss that topic further. I know TextMeshPro can track click events on single characters as well as words, but I have no idea where to start to make a word essentially a button that shows some specific text.

    Im not asking for someone to develop it for me, I just want to know what functions or systems I should research that could be related to this topic and could help me achieve this. I was thinking maybe I could just use TextMeshPro buttons and find some way to allign it with the rest of the text but I'm not sure of a way to do that in a natural looking way (not all mis-spaced and unaligned). I would rather track the click event on the word itself.
     
  2. zapman502

    zapman502

    Joined:
    Apr 13, 2020
    Posts:
    14
    I will add I did see an example of exactly what I wanted but I downloaded the files to test the sample scene but it was for an older version of unity and didn't work quite well so im assuming the code is outdated. Im hoping for a up to date, elegant solution.