Monday, February 11, 2019

Week 21

Week 21:

Creating My Enemy NPC – Part 2:


This week I began by watching a few videos on how I could create a script for my Monster NPC, which’ll let it move around and follow the player. After looking around, I began by creating a “Script” folder and then a C# Script I called “Monster”. I then allowed it to compile and then I dragged it onto the “Monster”. From what you can see below, I ended up using the following script for my “Monster” NPC.


I then dragged the script onto the “Player”. With this, the “Monster” NPC will now head directly straight towards the “Player”. I then went into the “Monster”, then pressed “Add Component” and added “AudioSource”. There, in the “Audio Source” section I then unclicked “Don’t Play On Awake”, changed the “Spatial Blend” from “2D” > “3D”.



After this, I edited the “Min Distance” to “1” and the “Max Distance” to “20”. As a result of the this, when the “Monster” is further away this means the further away the sound of the footsteps is and the closer they are, the closest and loudest the footsteps are. I then went back into the “Monster” script and added the following pieces. 



On the “Player”, I ended up turning off their “Volume” and then I moved to the “Monster”. Here, I dragged “Footstep01”and “Footstep02” from the “Player” to the “Footsounds” in the “Monster” script on the “Monster”. Basically, this means, when the “Monster” takes a step then they’ll play the “Footsteps” located in the “Footsounds”.

No comments:

Post a Comment

Week 34

Week 34: Critical Reflection: Conclusion: Over the course of this college year, I have managed to design, create and test my Horror-ba...