fixed combining branch

This commit is contained in:
slevy14 2023-04-27 20:12:07 -07:00
parent 1b634fd829
commit 153a1b4f8d
3 changed files with 17 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -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