So far I manage to code a simple script to do a primitive actions.
Here is a video for the demonstration of how the script work.
First the script detects if the player character standing nearby the NPCs and then trigger a guide button which I put statically;
Press E to talk.
The green boxy guidelines are the box collider in Unity that used as a trigger detector.
After the player press E, the script then trigger a functions to show the subtitle and play the speech.
I can make the subtitle to be dynamically inserted through the Unity editor but I think in future this won’t be enough. I was thinking to add a feature where I can add another line of subtitle dynamically, as well as the speech audio file. Currently the script only show 1 line of subtitle and play the attached audio clip. Will add more feature soon.
When player moving away, the script trigger another function to dismiss the subtitle and the guide button.
I’m now working towards to make an inventory so the player can pickup, use, drop and keep an items and money. Not yet in the programming stage but still deciding on the flowchart.
can i have a copy of the code used? plsss
I don’t keep this old project anymore.
Beside, this is VERY EASY to do with the new Unity GUI.