Towards the end of week 5 heading into week 6, I though this would be a good time to look into the scripting aspect of the story. A this stage I have imported the Unity First Person Controller so I am able to go ahead was walk around the Asylum to get feel for the atmosphere. There are multiple scripts that are attached onto the First Person Controller and the example below is a for the camera track viewer, allowing the player to look around using the mouse. It creates a private void within an function as well as a another function to monitor the collisions.
This screen shot below is the first person view of the Asylum, when the player is in the player is stationed in the first corridor. As the screen shot demonstrates, the texture has been distorted during the transfer from Unity to 3Ds Max. However I am impressed with how the rest of the asylum looks in game.

I also wanted to have a look at implementing the inventory counter on the GUI , so the player can collect items from the inventory room before they progress through the story. The inventory room is the first room behind the double doors ahead. In order for this to work I needed to write two scrips, one that will display the counter to the GUI and the other, as script which will destroy the game object when the player collides with the item.

So the script above is set to Public class cPickup, which creates a static variable called “inventory”, which is set to zero and will begin counting from there. I then needed to create a new public static which would draw out and new GUI label with those given Rect positions and I could the call the actual label @Inventory which will display on the GUI a long with the int 0.

The second script above called cCounter, which is the script that allows the collisions to take place. I again created a public class variable called cCounter, followed by an void trigger command, which calls the cPickup script and refers to the inventory variable from that script. Once the collision takes place, the counter increases by one on the (gameObject) item is destroyed. Currently I am planning on using a boolean expression to limit the user to only pick up to items, but I wanted to ensure that this script, operated correctly first. I have also added a trigger to the Door which calls the cPickup script to ensure the player collect all of the items before they can carry on. Until the player has collected all of the items, the door will not open. This script is directly below, and for now the item list is set to 5 which is all the collectible items though we may increase this as we develop further.

The screenshot above is a area of the inventory room, with an example of some of the items that can be picked up and the video below will illustrate that the script is indeed working fine.
The video Link: https://www.youtube.com/watch?v=_CU-ekJe6kQ&feature=youtu.be

On screen Help
In order to help the player a long with the narration of the story, the group thought it would be a good idea to on screen pop ups for extra support. In order to create these I created a GUI button in a script which is activated by certain triggers which are placed in the asylum. The player then has the option to read the on screen message and then close it.

Th script above creates a new game object and looks for the trigger function that the script will be added to, in this case when the player collides with the box collider. A bool expression is used to check whether the expression is true and if so the messages appears on screen. A GUI button had to be used as oppose to a label or box so the player could click to exit and destroy it, but the button still uses the same parameters when it comes to sizing. 