Hey guys,
I have figured out a very strange bug in my game, and I have absolutely no idea how to fix it. The game involved problems sliding down, instantiated at different intervals and moving downwards using Transform.Translate. When I make the game full screen however, the fps drops, and the problems overlap.
Look at the two screenshots I posted. The problems in my game overlap in fullscreen, but instantiate properly in windowed mode, most likely because of the fps. I am trying to get the problems to not graphically overlap, even when the game is lagging.
The instantiation acts the same regardless of time.deltaTime or time.fixedDeltaTime. It also doesn’t change with fixedUpdate or Update. What confuses me is that I’m using a timer with time.deltaTime to instantiate problems, and a Transform.Translate with time.deltaTime to move them, and yet I feel like one of them is somehow out of sync. I have no idea why the change in fps would modify the movement speed of the objects in my game, and yet would make the instantiation at the normal speed. Basically, while the objects move slower, the instantiation is still the same – but they are both involved through time.deltaTime, so why would they be so different ?
you want to use Time.deltaTime all the time, if you put it in the FixedUpdate then it will return with the fixedDeltaTime, so does not matter, but in Update you want to use the deltaTime since you need the last frame time
for now, change your Random to a constant (just for test), then check the console and then check the build’s output.txt and check if the numbers are the same
if the numbers are the same, you’re experiencing some graphics issue, if different, then your Math is wrong
also check the Player log because you may have some problems in the build so you can have some idea, what’s happening
or it’s nothing to do with fps and your just running into a problem with those fixed values in the script not applying to resolutions other than the one you used in the editor… ? those float values seem a little arbitrary