diff --git a/Assets/Scripts/Mechanics/PlayerController.cs b/Assets/Scripts/Mechanics/PlayerController.cs index 342a457..8bc7153 100644 --- a/Assets/Scripts/Mechanics/PlayerController.cs +++ b/Assets/Scripts/Mechanics/PlayerController.cs @@ -46,6 +46,10 @@ namespace Platformer.Mechanics private float dropThroughTimer = 0f; // 활성 시간 동안 Layer 16 mask 강제 OFF private const float DROP_THROUGH_DURATION = 0.3f; // Drop-Through 활성 지속 시간 (초) private bool dropThroughJump = false; // 본 frame Drop-Through 점프 발동 여부 (velocity.y 처리 분기) + + // BT72 — 점프 ascending 통과 일관성 (PD 질문 2026-05-08): 정점 영역 jitter 차단 + private float jumpAscentTimer = 0f; + private const float JUMP_ASCENT_DURATION = 0.4f; // 점프 시작 후 mask OFF 보장 시간 (정점 영역 jitter 차단) /*internal new*/ public Collider2D collider2d; /*internal new*/ public AudioSource audioSource; public Health health; @@ -178,6 +182,8 @@ namespace Platformer.Mechanics // BT69 — Drop-Through Timer 감소 (Layer 16 mask 강제 OFF 지속 시간) if (dropThroughTimer > 0f) dropThroughTimer -= Time.deltaTime; + // BT72 — Jump Ascent Timer 감소 (점프 ascending 통과 일관성) + if (jumpAscentTimer > 0f) jumpAscentTimer -= Time.deltaTime; UpdateJumpState(); base.Update(); @@ -198,6 +204,8 @@ namespace Platformer.Mechanics jumpState = JumpState.Jumping; jump = true; stopJump = false; + // BT72 — 점프 ascending 통과 일관성: Drop-Through 점프(velocity.y<0)는 Timer 활성 X (이미 dropThroughTimer 영역) + if (!dropThroughJump) jumpAscentTimer = JUMP_ASCENT_DURATION; // BT41 — PrepareToJump frame 영역 즉시 contactFilter Layer 16 mask OFF (다음 ComputeVelocity 영역 velocity.y 적용 영역 영역 frame 영역 발판 영역 충돌 차단) { int baseMaskJump = Physics2D.GetLayerCollisionMask(gameObject.layer); @@ -234,9 +242,11 @@ namespace Platformer.Mechanics // BT5-Dev #43 — IsGrounded 영역 폐기 (frame 0 미설정 → 떨어짐). footHit 단독 + 점프 영역 OFF 강제 // BT69 — Drop-Through Timer 활성 시 Layer 16 mask 강제 OFF (Down + Jump 입력 발판 통과) + // BT72 — Jump Ascent Timer 활성 시 mask 강제 OFF (정점 영역 jitter 차단·점프 통과 일관성) bool isJumpingThrough = jumpState == JumpState.Jumping || (jumpState == JumpState.InFlight && velocity.y > 0.01f) - || dropThroughTimer > 0f; + || dropThroughTimer > 0f + || jumpAscentTimer > 0f; bool standingOnPlatform = false; if (collider2d != null && !isJumpingThrough)