Getting an error… Looks exactly the same as on the lecture screen, but still an error.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ObjectHit : MonoBehaviour
{
private void OnCollisionEnter(Collision other)
{
if(other.gameObject.tag == "Player")
{
GetComponent<MeshRenderer>().material.color = Color.red;
}
}
}