Example #1
0
 private void Update()
 {
     if (m_inputController.JumpButtonDown && m_groundChecks.IsPlayerGrounded())
     {
         m_stateMachine.SetState(m_jumpState);
     }
 }
Example #2
0
 private void Update()
 {
     if (m_groundChecks.IsPlayerGrounded() && m_groundChecks.GroundAngle <= m_characterController.slopeLimit)
     {
         m_stateMachine.SetState(m_groundMovementState);
     }
 }
 private void Update()
 {
     if (!m_playerGroundChecks.IsPlayerGrounded())
     {
         m_stateMachine.SetState(m_fallingState);
     }
 }
Example #4
0
 private void ApplyGravity()
 {
     if (m_playerGroundChecks.IsPlayerGrounded() && m_playerTotalVelocity.TotalVelocity.y < 0.0f)
     {
         m_playerTotalVelocity.TotalVelocity = new Vector3(m_playerTotalVelocity.TotalVelocity.x, -1.0f, m_playerTotalVelocity.TotalVelocity.z);
     }
     m_playerTotalVelocity.TotalVelocity += new Vector3(0.0f, m_gravityValue * Time.fixedDeltaTime, 0.0f);
 }