Objects don't collide

Hi there!

I’ve made a sphere which follows user’s mouse. Here it’s script:

var mycamera: Camera;
mycamera = GameObject.Find("cam").camera;
function Update () 
    var mpos = Vector3.Normalize(mycamera.ScreenToWorldPoint(Input.mousePosition) - transform.position);
    transform.Translate(mpos * ( 5.0 * Time.deltaTime ) );
    transform.position.z = 0.0;
function OnCollisionEnter(theCollision : Collision)

I’ve also added a collider into it. After all, I’ve duplicated a sphere, so they’re both following mouse.

But they don’t collide (I don’t see ‘test’ message in console).

What am I doing wrong?

Its because youre using transform.Translate to move them.
Translate works just like you would change the position in the editor.

Try using rigidbody or charactercontroller to move objects.