I’m making a game in which enemies spawn based on how long the player has been on this certain level. I could use Time.timeSinceLevelLoad, but wouldn’t that depend on the player’s computer? Wouldn’t the enemies spawn differently on faster and slower computers? I think if it were frame-specific, and not time-specific, it would be better, right? Well, how do I do that?
Time is independent of the users computer. Frames are. You have the two mixed up
You have it backwards, I think. Framerate varies from computer to computer, so if you went by frames since level loaded, I would spawn enemies faster or slower depending on the power of my computer.
You want to use Time.timeSinceLevelLoad, because a second is a second, no matter the computer.
@Dman: gah! Too slow
Ah! Whoops. Thanks, you two!
Wait, I think I WANT it frame-rate-dependent, don’t I? I don’t want the spawn to be different for different computers.
No, framerate-dependent would mean that the rate of your spawn is dependent on (governed by) your framerate. Framerate-independent would mean that the rate of your spawn would not rely on the framerate, but something else (in your case, time).
So ultimately you want it to be time-dependent, but framerate-independent (which it would be with Time.timeSinceLevelLoad)
Lets say my computer runs at 10 FPS (it sucks I know :)). Yours runs at 30 FPS. You have it set up to spawn an enemy every 30 frames. In 1 second, I have no enemies (only 10 frames), while you have 1 (30 frames). In 3 seconds, I have 1 (30 frames), but you have 3 (90 frames). It keeps going on and on and on…
Ah! Again, thanks, you two!