From 153a1b4f8d0f1f50a90c12746fb1ac60dc1cbeaf Mon Sep 17 00:00:00 2001 From: slevy14 Date: Thu, 27 Apr 2023 20:12:07 -0700 Subject: [PATCH] fixed combining branch --- Assets/Prefabs/Player.prefab | 4 +++- Assets/Scenes/GrappleScene.unity | 8 ++++---- Assets/Scripts/PlayerController.cs | 12 ++++++++++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/Assets/Prefabs/Player.prefab b/Assets/Prefabs/Player.prefab index 903f1d9..fd926f5 100644 --- a/Assets/Prefabs/Player.prefab +++ b/Assets/Prefabs/Player.prefab @@ -252,7 +252,9 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: Data: {fileID: 11400000, guid: fec218a9d55267dedac6ebe31eab6dcd, type: 2} - _groundCheckSize: {x: 0.49, y: 0.93} + in_range: 0 + enemy: {fileID: 0} + _groundCheckSize: {x: 0.49, y: 0.57} _wallCheckSize: {x: 0.5, y: 1} _groundLayer: serializedVersion: 2 diff --git a/Assets/Scenes/GrappleScene.unity b/Assets/Scenes/GrappleScene.unity index e6b07df..6dc1e51 100644 --- a/Assets/Scenes/GrappleScene.unity +++ b/Assets/Scenes/GrappleScene.unity @@ -357,11 +357,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 493245979038171992, guid: d175e4c5882b2464ab0425220d00a671, type: 3} propertyPath: m_LocalPosition.x - value: -30.56 + value: -14.54 objectReference: {fileID: 0} - target: {fileID: 493245979038171992, guid: d175e4c5882b2464ab0425220d00a671, type: 3} propertyPath: m_LocalPosition.y - value: -10.5 + value: -10.53 objectReference: {fileID: 0} - target: {fileID: 493245979038171992, guid: d175e4c5882b2464ab0425220d00a671, type: 3} propertyPath: m_LocalPosition.z @@ -1365,7 +1365,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &724240633 RectTransform: m_ObjectHideFlags: 0 @@ -2670,7 +2670,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &1385054184 RectTransform: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/PlayerController.cs b/Assets/Scripts/PlayerController.cs index 3c7dc7f..5b57219 100644 --- a/Assets/Scripts/PlayerController.cs +++ b/Assets/Scripts/PlayerController.cs @@ -97,6 +97,12 @@ public class PlayerMovement : MonoBehaviour CheckDirectionToFace(_moveInput.x > 0); #endregion + if (!IsJumping) { + print("not jumping"); + } else { + print("jumping, " + RB.velocity.y); + } + #region COLLISION CHECKS if (!IsJumping) { @@ -119,12 +125,14 @@ public class PlayerMovement : MonoBehaviour //Two checks needed for both left and right walls since whenever the play turns the wall checkPoints swap sides LastOnWallTime = Mathf.Max(LastOnWallLeftTime, LastOnWallRightTime); + } #endregion #region JUMP CHECKS - if (IsJumping && RB.velocity.y < 0) + if (IsJumping && RB.velocity.y <= 0) { IsJumping = false; + print("isJumping " + IsJumping); if (!IsWallJumping) _isJumpFalling = true; @@ -216,7 +224,6 @@ public class PlayerMovement : MonoBehaviour SetGravityScale(Data.gravityScale); } #endregion - } } private void FixedUpdate() @@ -419,6 +426,7 @@ public class PlayerMovement : MonoBehaviour } public bool IsGrounded() { + // print(Physics2D.OverlapBox(this.transform.position, _groundCheckSize, 0, _groundLayer) && !IsJumping); return (Physics2D.OverlapBox(this.transform.position, _groundCheckSize, 0, _groundLayer) && !IsJumping); } #endregion