Added checkpoints
This commit is contained in:
@@ -4,6 +4,10 @@ using UnityEngine.Events;
|
||||
public class CharacterController2D : MonoBehaviour
|
||||
{
|
||||
public float m_JumpForce = 400f; // Amount of force added when the player jumps.
|
||||
|
||||
public AudioSource SFX;
|
||||
public AudioClip JumpSFX;
|
||||
|
||||
[Range(0, .3f)] [SerializeField] private float m_MovementSmoothing = .05f; // How much to smooth out the movement
|
||||
[SerializeField] private bool m_AirControl = false; // Whether or not a player can steer while jumping;
|
||||
[SerializeField] private LayerMask m_WhatIsGround; // A mask determining what is ground to the character
|
||||
@@ -83,6 +87,8 @@ public class CharacterController2D : MonoBehaviour
|
||||
// Add a vertical force to the player.
|
||||
m_Grounded = false;
|
||||
m_Rigidbody2D.AddForce(new Vector2(0f, m_JumpForce));
|
||||
SFX.clip = JumpSFX;
|
||||
SFX.Play();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user