I have a game that I have released for iOS, and on all iOS platforms the player moves up the screen at the same speed. It also moves up the same speed in the Editor.
However, I have now changed the project type to OSX and I am finding that when the app is compiled and launched on the desktop it is moving much slower. Also, if something slows down my Mac (for example notifications arriving) then it briefly speeds up.
I am moving the player in the following way, inside an Update function:
Isn’t that the right way to get a constant speed by multiplying by Time.deltaTime?
On iOS and OSX the thrust value is 55.0. On the Editor the Time.deltaTime is usually around 0.004 but on the built player it is usually 0.002. On iOS it is usually around 0.03.
PS This is an 8 core 2008 Mac Pro with a fast Nvidia GTX 670 card.
Sounds like your Mac is having issues running the game. Time.deltaTime always results in correct time increments unless there’s a catastrophic failure.
.002 is great, and your thrust is the same on both systems. Does -everything- move slowly? Did you change timescale?
I’ve had a problem like this before and the solution I used is in fact pretty simple. All you gotta do is to put the Time.deltaTime part on the FixedUpdate(), instead of Update(). Doing something like the following should solve your problem:
I’ve just recently hit this problem when running Unity 2019.1.1f1 with a 2018 MacBook Pro. So in case anyone else stumbles across this issue, this may help.
I found the Time.deltaTime returned by the runtime Mac build was almost 10 times faster than the Unity Editor.
When I forced the Application.targetFrameRate = 60; both the UnityEditor and the runtime build became consistent.
Possibly the Unity Editor targetFrameRate is capped on Mac platforms? Note, I haven’t seen this issue on a PC platform running Windows 10.