diff --git a/Gameton-06/Assets/Gameton/Resources/Player/TON.Player_B.prefab b/Gameton-06/Assets/Gameton/Resources/Player/TON.Player_B.prefab index 6c01de3b..04482d63 100644 --- a/Gameton-06/Assets/Gameton/Resources/Player/TON.Player_B.prefab +++ b/Gameton-06/Assets/Gameton/Resources/Player/TON.Player_B.prefab @@ -107,7 +107,7 @@ BoxCollider2D: adaptiveTiling: 0 m_AutoTiling: 0 serializedVersion: 2 - m_Size: {x: 0.25, y: 0.15} + m_Size: {x: 0.2, y: 0.1} m_EdgeRadius: 0 --- !u!114 &6824007025137790925 MonoBehaviour: @@ -121,9 +121,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 75a6dd00ee9c3d7428cae5700b2cc666, type: 3} m_Name: m_EditorClassIdentifier: - groundLayer: - serializedVersion: 2 - m_Bits: 512 --- !u!1 &2757306338607502731 GameObject: m_ObjectHideFlags: 0 @@ -374,7 +371,6 @@ MonoBehaviour: speed: 3 jumpForce: 8 airControl: 0.8 - sideCheckDistance: 0.5 groundCheck: {fileID: 427864611187260801} groundCheckRadius: 0.1 groundLayer: diff --git a/Gameton-06/Assets/Gameton/Resources/Player/TON.Player_W.prefab b/Gameton-06/Assets/Gameton/Resources/Player/TON.Player_W.prefab index f3e39d7a..6cecda94 100644 --- a/Gameton-06/Assets/Gameton/Resources/Player/TON.Player_W.prefab +++ b/Gameton-06/Assets/Gameton/Resources/Player/TON.Player_W.prefab @@ -107,7 +107,7 @@ BoxCollider2D: adaptiveTiling: 0 m_AutoTiling: 0 serializedVersion: 2 - m_Size: {x: 0.25, y: 0.15} + m_Size: {x: 0.2, y: 0.1} m_EdgeRadius: 0 --- !u!114 &6530647677844077835 MonoBehaviour: diff --git a/Gameton-06/Assets/Gameton/Scripts/Character/CharacterBase.cs b/Gameton-06/Assets/Gameton/Scripts/Character/CharacterBase.cs index fc626ae7..b917e70d 100644 --- a/Gameton-06/Assets/Gameton/Scripts/Character/CharacterBase.cs +++ b/Gameton-06/Assets/Gameton/Scripts/Character/CharacterBase.cs @@ -116,23 +116,21 @@ namespace TON else { // 기본 이동 속도 계산 - float newVelocityX = horizontalInput * (isGrounded ? speed : speed * airControl); + float newVelocityX = horizontalInput * speed; // 경사로 감지 bool isOnSlope = false; Vector2 rayOrigin = rb.position; RaycastHit2D hit = Physics2D.Raycast(rayOrigin, Vector2.down, 1.1f); - if (!isGrounded) // Ground 충돌 확인 + + float slopeAngle = Vector2.Angle(hit.normal, Vector2.up); + if (slopeAngle > 0 && slopeAngle <= 45f) { - float slopeAngle = Vector2.Angle(hit.normal, Vector2.up); - if (slopeAngle > 0 && slopeAngle <= 45f) - { - isOnSlope = true; - // 경사면 방향 벡터 계산 - Vector2 slopeDirection = new Vector2(hit.normal.y, -hit.normal.x); - rb.velocity = slopeDirection * (newVelocityX / Mathf.Cos(slopeAngle * Mathf.Deg2Rad)); - } + isOnSlope = true; + // 경사면 방향 벡터 계산 + Vector2 slopeDirection = new Vector2(hit.normal.y, -hit.normal.x); + rb.velocity = slopeDirection * (newVelocityX / Mathf.Cos(slopeAngle * Mathf.Deg2Rad)); } // 경사가 아닐 경우 일반 이동 적용 diff --git a/Gameton-06/Assets/Gameton/Scripts/Character/WallChecker.cs b/Gameton-06/Assets/Gameton/Scripts/Character/WallChecker.cs index 734d4f9a..b58e560e 100644 --- a/Gameton-06/Assets/Gameton/Scripts/Character/WallChecker.cs +++ b/Gameton-06/Assets/Gameton/Scripts/Character/WallChecker.cs @@ -8,14 +8,14 @@ namespace TON { public bool IsWallTouching { get; private set; } - private void OnTriggerStay2D(Collider2D other) + private void OnTriggerStay2D(Collider2D collision) { - IsWallTouching = other.gameObject.layer == LayerMask.NameToLayer("Ground"); + IsWallTouching = collision.gameObject.layer == LayerMask.NameToLayer("Ground"); } - private void OnTriggerExit2D(Collider2D other) + private void OnTriggerExit2D(Collider2D collision) { - if (other.gameObject.layer == LayerMask.NameToLayer("Ground")) + if (collision.gameObject.layer == LayerMask.NameToLayer("Ground")) { IsWallTouching = false; }