Monday 7 December 2015

Craig Lang - Game Design: Early Scripting



Early Scripting




I was given the first greybox design from my character artist. From there I added several cameras and trigger boxes. 



I also added this door script to all the doors. I grabbed this script from an old project file. the script allows the door to rotate on it's axis when player enters the trigger. 





I realised that not only does my original camera script not work properly in my new project, but it's not efficient coding. I therefore created a new script for the camera with the help from other game designers. This script calls the main camera to camera areas when the player enters that trigger.  This means I can have one camera active and call it to any position I want within the level.


I added a Nav mesh to the scene in order to start working on the point and click movements. I had to adjust the area radius very low as I wanted to make sure the Nav mesh covered the whole area.



I used globals to identify whether a key has been collected or not when constructing my keys. I had to create two globals scripts as I came across a weird error when unity refused me to add more than six globals to one script.


On the keys I created public game objects for the key itself and and audio. I used onmousedown so that when the player clicks on the key it calls the globals and also the audio. I also made sure that the mesh renderer is destroyed as well.  When the player exits the trigger the audio is destroyed. 




I created a capsule for the player and added thirdpersonscripts already present in unity. I also added a rigdbody and a Navmesh agent. This allows the player to physically interact with the environment. I added a playermove script which allows the player to identify the navmesh and it's target object. I then created a sphere for the target and added a targetscript.    







I decided to start creating my menus. I created separate scenes for each menu. One for the main menu, one for the options menu, a sound menu, video menu and subtitles menu. On each button I assigned an event trigger and called its respected function from the menuoptions script. I use the loadlevel script function which calls and loads which ever script matches the number in the build settings.



No comments:

Post a Comment