Player moving faster when maximized game view

Hey guys,
every time when my game view is maximized, the player moves a lot faster, as when the game view is not maximized. Does someone know how to fix that?

Here’s my movement code (it’s on void Update):

  //Movement
  float x = Input.GetAxisRaw("Horizontal");
  float z = Input.GetAxisRaw("Vertical");

  Vector3 move = transform.right * x + transform.forward * z;

  velocity.y += gravity * Time.fixedDeltaTime;
  controller.Move(move * speed * Time.fixedDeltaTime);
  controller.Move(velocity * Time.fixedDeltaTime);

If you move it to FixedUpdate() it should work better. The reason for this is probably that the framerate is lower when you maximize the window, so Update() runs less often. But you still use Time.fixedDeltaTime which is constant (20 ms probably). Otherwise you can change Time.fixedDeltaTime to Time.deltaTime and keep it in Update().


Update: Why you would want to do physics in FixedUpdate() and not in Update():
With fixedDeltaTime timing is constant, and if you run the game on different computers with different frame rate the game objects would behave slightly different if you do it with deltaTime. That is reason enough, but what if you would like to record and replay a sequence? Or if you want to make the game multiplayer over Internet…

Thanks for the reply!
When I change Update to FixedUpdate the Scene stuttering.