I’m trying to make a game where you can farm metals. I’m just using the standard tile system where I have 20 tiles. One is grass, the others are metal plants and the seeds for them. Say I want it where if I collide with a bronze plant, I can do something, such as Debug.Log(“Bronze”) for starters? This is all I have for now, it is currently doing nothing when I hit the bronze plant, so not very useful.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FindPlant : MonoBehaviour
{
void OnCollisionEnter(Collision col)
{
if (col.gameObject.name == "tilemap_1")
{
Debug.Log("Bronze");
}
}
}