Esempio n. 1
0
    //Movement method
    private void Movement()
    {
        //Calculate the axis of movement
        float _horizontal = Input.GetAxis("Horizontal");
        float _vertical   = Input.GetAxis("Vertical");

        Vector3 _direction = transform.right * _horizontal + transform.forward * _vertical;

        //Move the player
        motor.Move(_direction, speed);

        //If is is grounded then can jump
        if (motor.isGrounded)
        {
            if (Input.GetKeyDown(KeyCode.Space))
            {
                motor.Jump(jumpForce);
            }
        }
    }
Esempio n. 2
0
 void Jump()
 {
     motor.Jump(speed_Jump);
 }
Esempio n. 3
0
 void Jump()
 {
     motor.Jump(jumpPower);
 }