2026-05-18 기획 수정 : 플레이어와 에너미의 body간 충돌은 없다
This commit is contained in:
@@ -73,6 +73,7 @@ public void TakeDamage(int amount, Vector2 hitVelocity = default, string hitReac
|
||||
if (_anim != null && !string.IsNullOrEmpty(hitReactionAnimationState))
|
||||
_anim.Play(hitReactionAnimationState);
|
||||
|
||||
// HitVelocity is an immediate launch/knockback velocity, not an additive force.
|
||||
if (_rb != null)
|
||||
{
|
||||
Vector2 nextVelocity = GetHitReactionVelocity(hitVelocity);
|
||||
@@ -116,6 +117,7 @@ private void OnCollisionExit2D(Collision2D collision)
|
||||
|
||||
private Vector2 GetHitReactionVelocity(Vector2 hitVelocity)
|
||||
{
|
||||
// Airborne follow-up hits pop the enemy with a fixed Y velocity for stable combos.
|
||||
if (_hitReactionTimer <= 0f || _isGrounded)
|
||||
return hitVelocity;
|
||||
|
||||
@@ -139,6 +141,7 @@ private void UpdateGroundedState(Collision2D collision)
|
||||
|
||||
private void BounceOffWall(Vector2 wallNormal)
|
||||
{
|
||||
// While in hit reaction, side-wall impacts reflect the current knockback.
|
||||
Vector2 incomingVelocity = _lastVelocity.sqrMagnitude > _rb.linearVelocity.sqrMagnitude
|
||||
? _lastVelocity
|
||||
: _rb.linearVelocity;
|
||||
|
||||
Reference in New Issue
Block a user