Hello, Unity is giving me these two errors and not recognising Destroy()
error CS1503: Argument #1' cannot convert string’ expression to type UnityEngine.Object' error CS1502: The best overloaded method match for UnityEngine.Object.Destroy(UnityEngine.Object)’ has some invalid arguments
Here is my code:
using UnityEngine;
using System.Collections;
public class ContactWithPlayerKill : MonoBehaviour
{
void OnCollisionEnter (Collision col)
{
if (col.gameObject.tag == "Player")
{
KillPlayer();
}
}
void KillPlayer ()
{
Destroy("Player");
}
}