
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
고양이에게 콜라이더2D를 주고 밥에 콜라이더랑 리지드바디2D를 줬는데 밥을 줘도 맞았다! 디버그 메시지가 출력이 안됩니다.. 푸드에 태그도 줬구요, 뭐가 문젤까요....


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class cat : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
float x = Random.Range(-8.5f, 8.5f);
float y = 30f;
transform.position = new Vector3(x, y, 0);
}
// Update is called once per frame
void Update()
{
transform.position += new Vector3(0, -0.05f, 0);
}
void OnTriggerEnter2D(Collider2D coll)
{
if (coll.gameObject.tag == "food")
{
Debug.Log("맞았다!");
}
}
}
