Kinematic = false on player collision

I am trying to use the kinematic option in conjunction with simple cubes and a simple script to create platforms that fall when you land on them.

function OnTriggerEnter (col : Collider) { this.rigidbody.isKinematic = false; Destroy(this.gameObject, 3); }

function OnCollisionEnter() { this.rigidbody.isKinematic = false; Destroy(this.gameObject, 3); }

I have tried using both of these functions and neither seem to do the job, I am not using any complex character controller code, simply the lerpz tutorial messing around. is there something I am doing wrong?

this script is simply placed on a cube however I get no response once my player lands on it

1 Answer

1

Assuming your platform isn't a trigger, you want the second one, though your function definition isn't correct

Try this:

function OnCollisionEnter(collision : Collision) {