using UnityEngine;
using System.Collections;
public class deathOnTouch : MonoBehaviour {
void OnCollisionEnter (Collision col)
{
if(col.gameObject.name == "character")
{
Destroy(col.(GetComponent<MeshRenderer>));
}
}
}
using UnityEngine;
using System.Collections;
public class deathOnTouch : MonoBehaviour {
void OnCollisionEnter (Collision col)
{
if(col.gameObject.name == "character")
{
Destroy(col.(GetComponent<MeshRenderer>));
}
}
}
Your synthax is a bit messy. It should be
Destroy(col.GetComponent<MeshRenderer>());