// 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);
}
최종 수정!
'Game Programming > Unity' 카테고리의 다른 글
유니티 비전프로 언바운디드 앱 예시 (0) | 2025.02.06 |
---|---|
[Unity] getcomponentsinchildren 에서 부모(자기자신) 제외하는법 (0) | 2024.08.29 |
[Unity3D] 효율적인 메모리 관리 - Occulusion Culling (0) | 2024.08.27 |