Пример #1
0
    void Movement()
    {
        rigidBody.AddForce(Vector3.down * DownForce * Time.deltaTime); // keep player on the ground.

        PlayerJump.HandleJumping(rigidBody);

        Vector3 forward = camera.transform.forward;
        Vector3 right   = camera.transform.right;

        rigidBody.AddForce(forward * PlayerInput.verticalMovement * MovementSpeed * Time.deltaTime * PlayerInput.movementMultiplier);
        rigidBody.AddForce(right * PlayerInput.horizontalMovement * MovementSpeed * Time.deltaTime * PlayerInput.movementMultiplier);
    }