I am getting an error.
And this is my code:
using UnityEngine;
public class Collision : MonoBehaviour
{
private void OnCollisionEnter(Collision other)
{
switch(other.gameObject.tag)
{
case "Friendly":
Debug.Log("Friendly");
break;
case "Finish":
Debug.Log("Finish");
break;
case "Fuel":
Debug.Log("Fuel");
break;
default:
Debug.Log("Harmful");
break;
}
}
}
Can you tell me which part of my code is wrong?