I have the following code. What it supposedly does is check whether a sphere (which is attached to a bone, which is itself controlled by Kinect) has collided with any of the declared (and assigned) Cubes. What is wrong with this code?
var TOPLEFT:GameObject;
var TOP:GameObject;
var TOPRIGHT:GameObject;
var RIGHT:GameObject;
var BOTRIGHT:GameObject;
var BOT:GameObject;
var BOTLEFT:GameObject;
var LEFT:GameObject;
function OnTriggerEnter(coll:Collider)
{
if (coll.gameObject==TOPLEFT)
{
Debug.Log("TopLeft");
}
if (coll.gameObject==TOP.gameObject)
{
Debug.Log("Top");
}
if (coll.gameObject==TOPRIGHT)
{
Debug.Log("TopRight");
}
if (coll.gameObject==RIGHT)
{
Debug.Log("Right");
}
if (coll.gameObject==BOTRIGHT)
{
Debug.Log("BottomRight");
}
if (coll.gameObject==BOT)
{
Debug.Log("Bottom");
}
if (coll.gameObject==BOTLEFT)
{
Debug.Log("BottomLeft");
}
if (coll.gameObject==LEFT)
{
Debug.Log("Left");
}
}