[Solved]Editor/web build velocity faster

edit: stupid mistake

Any way I can bring standalone build up to speed?

As an example, here’s a snippet of code:

velocity = speed * transform.forward * Time.deltaTime;
newPos += velocity * Time.deltaTime; 
transform.position = newPos;

In a standalone build (Windows), it moves noticeably slower than in editor and web build. Target platform is standalone build so it’s important.

Is it because it’s not in FixedUpdate? It’s in its own function.

If you have speed differing in different environments, then you’ve made the code framerate-dependent in some way, but you haven’t posted enough to tell where the problem is. FixedUpdate is only for physics.

–Eric

doh… yeah posted the wrong code.

in Update:

newPos += velocity * Time.deltaTime; 
transform.position = newPos;

This is what moves the object. I think my problem was that I doubled on up deltaTime haha. Must have been confused when I added it to the velocity calculation.