I have a line:
private void OnTriggerEnter2D(Collider2D collider)
{
checkID = compareCollidercollider.GetComponent<PartInfo>().ID;
}
That PartInfo.cs:
using System;
using UnityEngine;
public class PartInfo : MonoBehaviour
{
[SerializeField] int id = 0;
GameObject parent = null;
public int ID { get { return id; } }
}
So I see this error on "checkID =" line. I don't understand why. Help me understand it, please :)