Ok, I’m getting a little pissed off because I can not for the life of me get this to work! I have a simple box (WITH COLLIDER) that is supposed to move towards a sphere (AGAIN WITH COLLIDER). Neither of them are triggers.
When the box hits the sphere, its supposed to print out “HIT!” in the debug log. Instead, it doesn’t do anything but shake around. (I know its supposed to shake, but its not registering a collision at all).
I have looked at every tutorial I can find with no luck. here is the code for the box:
var target1 : Transform;
var target2 : Transform;
var which = true;
function Update () {
if (which == true){
transform.LookAt(target1);
}else{
transform.LookAt(target2);
}
transform.Translate(Vector3.forward * Time.deltaTime * 3);
}
function OnCollisionEnter(collisionInfo : Collision){
//which = false;
Debug.Log(“HIT!”);
}
Any Ideas? I don’t want to use Rigid Bodies since neither the box nor the sphere are supposed to be physics objects.
thankyou.