I want that if I pass over the gameObject it destroys and give me the message, what I’m not doing right?
#pragma strict
function Start () {
}
var rotationSpeed : float = 100.0;
function OnTriggerEnter(col : Collider){
if(col.gameObject.tag == "Player"){
col.gameObject.SendMessage("CellPickup");
Destroy(gameObject);
}
}
function Update () {
transform.Rotate(Vector3(0,rotationSpeed * Time.deltaTime,0));
}
Thanks!