making an enemy in a unity game code example
Example: How to make an enemy unity
private void OnCollisionEnter(Collision collision)
{
if(collision.gameObject.tag == "Enemy")
{
Destroy(gameObject);
}
private void OnCollisionEnter(Collision collision)
{
if(collision.gameObject.tag == "Enemy")
{
Destroy(gameObject);
}