[Help] Selectable/"Clickable" Text in UI

Hey guys,
So, I’m working on expanding PrisonBreak into an Interactive Fiction and one thing I’d like to do is have certain words within the body of my text “clickable” to essentially bring up a tooltip/seperate text ui that gives more information about the word selected.
I don’t know if I’m explaining this correctly, so I’ll try using examples. I’m writing a police procedural. While the player is being presented with the story, a word like “gun” would be clickable to bring up relevant information about the gun… this is to simulate the process of investigation.
So far, I’ve tried Breyer’s Intractable Text (https://forum.unity3d.com/threads/scripts-useful-4-6-scripts-collection.264161/) but couldn’t get it to work.
I’ve also tried making the entire body of text an input field and using OnPointerClick/OnPointerDown but that interacts with the entire text field and not with a single word.
I’m rather at my wit’s end here. Any idea on how to get this accomplished?
Thanks in advance

[Bump] Trying to not be drowned.

My thinking at the moment is to make a UI button with the visible elements removed and then creating a script for the buttons that follows the main ui text script and only have the buttons functional during the “scenes” that involve them.

Probably is nowhere near the cleanest solution… but it may work I guess.

Hey, this would be indeed a solution, but it might cause some problems if you run the game at different resolutions. I’ve browsed a bit and seems that there is a method called GetCursorStringIndex that could be a suitable solution for this like some user suggested at the unity 3d forum in this thread, although I’ve never used this before.

Privacy & Terms