September 2010
Beginner
384 pages
8h 49m
English
Pop open the CharacterScript and let's get bizzay.
function OnCollisionEnter(col : Collision)
{
if(col.gameObject.tag == "bomb")
{
// I got hit by a bomb!
}
else if (col.gameObject.tag == "stein")
{
animation.Play("catch"); // Ima catch that stein!
}
col.gameObject.transform.position.y = 50;
col.gameObject.transform.position.x = Random.Range(0,60);
}
Once again, our prior knowledge of useful game code serves us well. This line should already look familiar:
function OnCollisionEnter(col : Collision) {
We're declaring ...
Read now
Unlock full access