Exemplo 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);
            }
        }
    }
Exemplo n.º 2
0
 void Jump()
 {
     motor.Jump(speed_Jump);
 }
Exemplo n.º 3
0
 void Jump()
 {
     motor.Jump(jumpPower);
 }