타점1 [개발더미][Unity] 타점에 콜라이더 생성, Physic.OverlabSphere() protected override void OnAttack() { // 공격 발생시 동작 print("atk"); // 타점 주변의 콜라이더 중 Monster 레이어를 가진 콜라이더만 가져옴 // 문제 발생 : 3번째 공격부터 콜라이더 인식을 못함ㅋㅋ // 해결 -> rigidbody의 isKinematic을 체크하여 해결! Collider[] monsterColiders = Physics.OverlapSphere(attackPoint.position, 1, attackLayer); foreach (Collider col in monsterColiders) { print(col.gameObject.name + " attack"); if (col.GetComponent() == null) continue;.. 2023. 7. 25. 이전 1 다음