So I want to add a gameObject to a list when the collider triggers. So I add other.gameObject to get the gameObject of the collider. But then it says that other.gameObject is of type UnityEngine.GameObject and my list is containing the type GameObject. What is the difference?
List<GameObject> possibleItemsToPickup = new List<GameObject>();
if (other.gameObject.CompareTag("Item"))
{
possibleItemsToPickup.Add(other.gameObject);
Debug.Log("added Item");
}
This is just extracts of the code.