// Update is called once per frame void Update() { float inputH = Input.GetAxis("Horizontal"); controller.Move(inputH); if (Input.GetKeyDown(KeyCode.Space)) { controller.Jump(); } }
void Update() { float iH = Input.GetAxis("Horizontal"); c.Move(iH); if (Input.GetKeyDown(jumpKey) && c.isGrounded) { c.Jump(); } }
// Update is called once per frame void Update() { // Get input horizontal axis float inputH = Input.GetAxis("Horizontal"); // Move via inputH controller.Move(inputH); // Check if space is pressed if (Input.GetKeyDown(KeyCode.Space)) { // Jump controller.Jump(); } }