Physics after build feel different vs In-Editor (Time.deltaTime)

Hey all so I ran into this issue here.

Here’s a quick video to summarize it:

Let me know if you need any more details.

Thanks for your help in advance!

@Matthewj866 @AlwaysSunny

I’d like to thank both of you so much for all your help! I finally fixed it!

For anyone else suffering from these issues,

Use FixedUpdate() and Time.fixedDeltaTime for physics and movement!

These changed EVERYTHING!

I got 144fps both in the editor and on a standalone build.
The actual gameplay is now 1:1.

Originally, I didn’t want to use FixedUpdate() that much because it looked like all the movement was jittery. Although I think Time.fixedDeltaTime was the trick to fix that.

I did tweak some project settings but to no avail. It was FixedUpdate() and Time.fixedDeltaTime that fixed everything!

Thanks for your help!

Hey y’all, I seem to be struggling with the same thing. I have a spaceship flight sim going on right now, and here’s the code to move:

void Thrust() {
    if (Input.GetAxis("Accelerate") > 0 && !atWall)
    {
        transform.position += transform.forward * Speed * Time.fixedDeltaTime * Input.GetAxis("Accelerate");
    }
    else
    {
        Speed = baseSpeed;
        isBoosting = false;
    }

    if (Input.GetButton ("Turbo") && canBoost && !atWall) {
		Speed = boostSpeed;
		isBoosting = true;
		Debug.Log ("pressing space");
	} else {
		//turn off boost when not pressing the button
		Speed = baseSpeed;
		isBoosting = false;
	}
}

So not only is the physics being handled under fixedUpdate, but the if statements handling the input as well. It fixed the timing issue in the editor when I hit the play on the spaceship scene, and when I start on the main menu and transition to the ship scene.

And here’s the code for using the boosters:

if (isBoosting) {
	//use boost
	Stamina -= staminaMultiplier;
} else if (!isBoosting && Stamina < maxStamina && canRegen) {
	//recover boost. canBoost basically caps so you cant go over 100 when you're resting
	Stamina += staminaMultiplier;
} else {
	
} 

But yet when I compile/build the game, I noticed that the stamina/fuel for using the boosters goees down/fills up around 10x slower than it does in the editor? Despite having fixed the continuity error between scenes in the editor already. I’m still confused as to why FixedUpdate and fixedDeltaTime don’t seem to be working when compiled into the exe