diff --git a/Assets/JYY/Prefabs/Bullets/Magic Missaile.prefab b/Assets/JYY/Prefabs/Bullets/Magic Missaile.prefab index c7bbc27d..a06b9f98 100644 --- a/Assets/JYY/Prefabs/Bullets/Magic Missaile.prefab +++ b/Assets/JYY/Prefabs/Bullets/Magic Missaile.prefab @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d51e7bbc994507d09d8e41c524596021b31347e399b76074317e2fa3b19fbbc2 +oid sha256:f2ca28b16f1e9e6161b75435af51d2f18fae41effe525d00ab1eb6746f5235cb size 10895 diff --git a/Assets/Scripts/Character/Enemy/Bullet/BulletBase.cs b/Assets/Scripts/Character/Enemy/Bullet/BulletBase.cs index 788d8b55..3020b535 100644 --- a/Assets/Scripts/Character/Enemy/Bullet/BulletBase.cs +++ b/Assets/Scripts/Character/Enemy/Bullet/BulletBase.cs @@ -51,9 +51,15 @@ public class BulletBase : MonoBehaviour float moveDist = _speed * Time.deltaTime; // 1) Raycast 충돌 검사 - if (Physics.Raycast(_prevPosition, _direction, out RaycastHit hit, moveDist, _targetLayer)) + if (Physics.SphereCast( + _prevPosition, + 1, + _direction, + out RaycastHit hit, + moveDist, + _targetLayer + )) { - // 닿은 지점으로 이동 transform.position = hit.point; OnBulletHit(hit); return; @@ -85,4 +91,11 @@ public class BulletBase : MonoBehaviour Debug.Log("## Bullet destroyed"); Destroy(gameObject); } + + // 기즈모로 반지름 시각화 + private void OnDrawGizmosSelected() + { + Gizmos.color = Color.red; + Gizmos.DrawWireSphere(transform.position, 1); + } } \ No newline at end of file