September 2010
Beginner
384 pages
8h 49m
English
We need to attach a new script to the heart. The script will respond to two important situations: when the heart hits the tray, and when the heart misses the tray completely and dive-bombs the Great Beyond. Let's create the script and add some simple code to it.
Update function:function OnCollisionEnter(col : Collision) {
if(col.gameObject.tag == "tray") {
Debug.Log("yes! hit tray!");
}
}
There's some new ...
Read now
Unlock full access