Help with simple Collision Detection, no rigid bodies.

Ok, i saw a few post about that but none of them are solving this problem.

I have a simple scene.

One Box

one Plane

Both objects created within unity and both objects with colliders (The plane a mesh collider, the box a box collider)

Now i’m using an script to move the box up and down, now i want to print a message everytime the box crosses the plane, something like

print (“i Crossed”);

One script i’m using is this, but don’t work, i was looking for the solution within the help, but i cannot find anything.

function Update () {
}
function OnCollisionEnter(collision : Collision) {
	print ("kaka");
}

Help please! i need this to understand the collisions.

Thanks!

Use OnTriggerEnter instead… OnCollisionEnter requires a non-kinematic rigidbody:

I tried too

function OnTriggerEnter (other : Collider) {
	print ("kaka");
}

But after that i noticed that:

You need to attach a rigidbody and make it kinematic.

Thanks, it workied…it’s not too elegant, but is working :slight_smile: