private void Update() { if (pauseMenu.isOn) { return; } RaycastHit _Hit; if (Physics.Raycast(transform.position, Vector3.down, out _Hit, 100f, environmentMask)) { joint.targetPosition = new Vector3(0f, -_Hit.point.y, 0f); } else { joint.targetPosition = new Vector3(0f, 0f, 0f); } float _xmov = Input.GetAxis("Horizontal"); float _zmov = Input.GetAxis("Vertical"); Vector3 _moveHorizontal = transform.right * _xmov; Vector3 _moveVertical = transform.forward * _zmov; Vector3 velocity = (_moveHorizontal + _moveVertical) * speed; animator.SetFloat("Blend", _zmov); motor.move(velocity); float _yrot = Input.GetAxisRaw("Mouse X"); Vector3 _rotation = new Vector3(0f, _yrot, 0f) * lookSensitivity; motor.getRotation(_rotation); float _xrot = Input.GetAxisRaw("Mouse Y"); float _camerarotationX = _xrot * lookSensitivity; motor.getCameraRotation(_camerarotationX); Vector3 thrusterForce = Vector3.zero; if (Input.GetButton("Jump") && actuaFuelamt > 0f) { actuaFuelamt -= fuelBurnspeed * Time.deltaTime; if (actuaFuelamt >= 0.01f) { thrusterForce = Vector3.up * thurstSpeed; setJointSettings(0f); } } else { actuaFuelamt += fuelregainSpeed * Time.deltaTime; setJointSettings(jointSpring); } actuaFuelamt = Mathf.Clamp(actuaFuelamt, 0f, 1f); motor.ApplyThrust(thrusterForce); }