Non-Playable Characters
This thread is about the NPCs, who use the NavMesh to move around the scene.
The NavMesh itself is a zone of the floor plan that dictates where the NPCs can move and where they cannot. This is shown as a blue sheet over the mesh of the map, and certain objects can either be ignored, so NPCs can move through them, or registered so NPCs will need to move around them. The script below shows how the NPC communicates with the NavMesh:
The origin point of the NPC allows them to roam the store when they are not chasing the player. This uses a blank gameobject as a reference point the NPC can move towards, which moves around to random points within the scene at random intervals.
Spawning the NPCs
When the player enters the store, they trigger a countdown that will tick down to zero. At changeable intervals, gameobjects that contain extra staff members or customers can be set to spawn, making the game more difficult the longer players play.
There is also a system to convert the seconds the counter is built with into minutes and seconds separately.
Scoring and friendly NPCs
Finally, to score the player must deposit their stolen goods in their ‘nest’. These goods are then stolen goods are then collected by the baby pigeons, which use a modified version of the NPC controller script to collect all of the objects. The objects are added to the score the moment they are dropped in the zone, so players get instant feedback on how much they have scored.










