[Photon] facing very strange problem.

I have setup a drag race using Photon.
Even though both devices have exact same car setup. They sync from the same iCloud keys, so they are identical.

However the car on a 32bit device(iPad 4th Gen.) always speeds up way too fast against car on 64bit device(iPhone7 plus).

Is there a logical explanation for that?
Using Real Car Controller v.3

Logically it would merely seem like the problem is both devices are running at different speeds, and Real Car Controller v.3 isn’t framerate independent, or your code isn’t.

How to make the code framerate dependent ? multiply by time.deltatime?

Yep, for the parts where the input is not a constant, but changing over time (acceleration for instance).

To test this is working on a local machine, you could enable vsync and change Application.TargetFramerate to emulate different speeds, and run the game side by side on same machine. You can then see if one of them is reaching the target at a different rate to another. Ideally they would both be within an acceptable range. This is just an initial way to test your delta time code is correct.

Alternatively if you’re really not into deltatime, you can just shovel the acceleration code into fixed update, it wont be amazingly accurate but it won’t be too bad either. This is considered a hack.

1 Like