// Get hit at basket
if (other.gameObject.tag == "Basket")
{
itemManager.instance.GetScore(1);
}
tag 비교를 이렇게 했더니
오늘도 조언해주시는 라이더씨
Unity - Scripting API: Component.CompareTag
Success! Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable. Close
docs.unity3d.com
other.gameObjet.compareTag() -> 이렇게 쓰려고 했는데
gameObject 생략해도 된다고 하네요~
// Get hit at basket
if (other.CompareTag("Basket"))
{
itemManager.instance.GetScore(1);
}
최종 수정!