Upgraded player

This commit is contained in:
2021-07-19 21:10:31 +02:00
parent 691a431895
commit 7886a53c70
84 changed files with 4228 additions and 654 deletions

View File

@@ -10,7 +10,7 @@ public class CharacterController2D : MonoBehaviour
[SerializeField] private LayerMask m_WhatIsGround; // A mask determining what is ground to the character
[SerializeField] private Transform m_GroundCheck; // A position marking where to check if the player is grounded.
[SerializeField] private Transform m_CeilingCheck; // A position marking where to check for ceilings
[SerializeField] private Collider2D m_CrouchDisableCollider; // A collider that will be disabled when crouching
[SerializeField] private CapsuleCollider2D m_CrouchDisableCollider; // A collider that will be disabled when crouching
const float k_GroundedRadius = .2f; // Radius of the overlap circle to determine if grounded
private bool m_Grounded; // Whether or not the player is grounded.
@@ -114,13 +114,13 @@ public class CharacterController2D : MonoBehaviour
if (move > 0 && !m_FacingRight)
{
// ... flip the player.
Flip();
//Flip();
}
// Otherwise if the input is moving the player left and the player is facing right...
else if (move < 0 && m_FacingRight)
{
// ... flip the player.
Flip();
//Flip();
}
}
// If the player should jump...