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)

No comments:

Post a Comment