Select Page
Trigger, Interaction Button, Show Subtitle, And Play Speech

Trigger, Interaction Button, Show Subtitle, And Play Speech

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;

Trigger Enter - Stay

Press E to talk.

The green boxy guidelines are the box collider in Unity that used as a trigger detector.

Press E to talk.

Show Robot Kyle dialogue.

After the player press E, the script then trigger a functions to show the subtitle and play the speech.

Show Alexis dialogue

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.

Using dynamic variable

Only 1 script to handle these 4 situations

Play audio attached to the game object.

When player moving away, the script trigger another function to dismiss the subtitle and the guide button.

Trigger ExitI’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.

Player Control Mechanism Using Mecanim in Unity 4.3.3f

Player Control Mechanism Using Mecanim in Unity 4.3.3f

Like I said in my previous post. I’m not a programmer.

I spent 2 days to research, learn and do trial and error while making just this SIMPLE mechanism.

There’s many ready solution in Unity Assets Store but I find them doesn’t satisfy my needs and beside most of the time is because I cannot understand the code. Another problem to consider is also the pricing. I want to make this game with as little resources as possible. Not because I’m stingy, but because I’m broke. sad Enough said.

This control mechanism is INSPIRED 100% from my favourite game Assassins Creed 3.

The mechanism are:

  • WSAD to WALK.
  • WSAD + Right Mouse to RUN.
  • WSAD + Right Mouse + Space to SPRINT (Faster than RUN).
  • Walk, run and spring in the mouse cursor direction.
  • 360 ° camera view around the player avatar. (Because I like to see the face of the main character sometimes.)

Here are some of the screenshots from the video.

This is not complete yet.

There’s still more functions that I wanted to add like, interaction, jump, focus on enemy, attack, shoot and etc.