Monday, 1 April 2013

Creating Footprints

In order to immerse the player more in the game and add to the ascetics of the game I started to included footsteps to be left by the players they walk.

Initially I attempted to do this by placing a projector above the player, and getting it to cast footprints down on the floor at a set interval. However this method did not give an accurate representation of footfalls so I decided to find a better way to do it.

After a little thinking and searching I came across a method that would would follow each foot as it hit the ground.

To begin with I attached cubes to the feet of the player, so that they would come into contact with the ground when the walk or run animations were played.



Next I attached a piece of script to each of them that would detect when they come into contact with the ground. However it quickly became apparent that I could not use Collision because this would interfere with player controls, causing the player to walk up into the air.


To get around this I used the cubes as triggers instead and altered the script to react to them.
Each trigger was then linked to a corresponding cube set up above the player which would instantiate the projector of the correct print when trigger came into contact with the floor.


The image below shows an example of the prints in action.



(DS 29/03/13)

Randomised death scenes

In order to stop death feeling too repetitive I decided to try and give the chance of seeing something different each death.
To this I took our death animation and posed it differently in three different ways in three different saved scenes.




After loading them into Unity's build settings I took note of where each of the scenes were loaded.


Finally in the Player's Controller script I wrote a piece of code to tell Unity to load any of the scenes that held the death animation (14 - 16) when the players health fell below 1.

(DS - 29/03/13)