From 06e92a8732319a863b7be448c744945222fd2440 Mon Sep 17 00:00:00 2001 From: swrring Date: Fri, 8 May 2026 00:35:02 +0900 Subject: [PATCH] =?UTF-8?q?BT5-Dev=20#72:=20=EC=A0=90=ED=94=84=20ascending?= =?UTF-8?q?=20=ED=86=B5=EA=B3=BC=20=EC=9D=BC=EA=B4=80=EC=84=B1=20(jumpAsce?= =?UTF-8?q?ntTimer)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PD 질문 (2026-05-08): "발판 방향 통과 시 밀려나는 현상. 깔끔하게 통과 또는 통과 X (착지) 둘 중 하나로" 진단: - ascending 판정: velocity.y > 0.01f (mask OFF Layer 16 통과) - 정점 영역 (velocity.y ≈ 0): 1~2 frame 동안 조건 X → standingOnPlatform 검사 활성 - = 발판 영역 진입 + footHit 검출 → mask ON 짧은 충돌 → 밀려남 (jitter) 정정 (BT72): - jumpAscentTimer 신규 (JUMP_ASCENT_DURATION = 0.4초) - PrepareToJump → Jumping 시 Timer 활성 (Drop-Through 점프 X — dropThroughTimer 영역으로 처리) - Update에 매 frame Timer 감소 - isJumpingThrough 조건에 jumpAscentTimer > 0f 추가 - = 점프 시작 후 0.4초 mask 강제 OFF → ascending·정점 일관 통과 - 0.4초 후 또는 descending velocity.y < -0.01 → standingOnPlatform 검사 활성 → 발판 위 착지 효과: - 발판 방향 점프 = 깔끔 통과 (정점 영역 밀려남 X) - 발판 위 떨어지면 착지 (descending standingOnPlatform 검사) - 일반 점프·Drop-Through·전진 점프 영역 그대로 후속 의무: - PD Refresh+Play 시각 검증 (발판 통과 일관성) - 정합 시 BT72 영역 영구 채택 --- Assets/Scripts/Mechanics/PlayerController.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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)