Tuesday, 5 February 2013

05/02/2013 Unity Research



Well for my final semester module DES 509, I'm going to try create a demo of my game; Resource.




I'm going to be using the unity engine to run this but first i have to learn myself!

I've been researching how some thing are going to work so i figured i'd document everything.


I'll be learning JavaScript since its the easiest for newbs


I've been looking at different functions i'll be using for game play and the ui.

Firstly OnGUI will allow me to give the player a visual of what their health is.



// JavaScript
function OnGUI () {
 if (GUI.Button (Rect (10,10,150,100), "I am a button")) {
  print ("You clicked the button!");
 }
}
Secondly The Function OnTriggerStay will allow your character to interact with with game effects such as fire by collision.
If the character stands in the fire, their health will decrease until out of the fire.
I will also use this Function for triggering door animations.


// Applies an upwards force to all rigidbodies that enter the trigger.

function OnTriggerStay (other : Collider) {
    if (other.attachedRigidbody) {
        other.attachedRigidbody.AddForce(Vector3.up * 10);
    }
}