How do you make a Unity 3D 3.0 game speed processor independent ?

I know from other game engines that there are ways to make a game’s speed processor independent.

In 3D Gamestudio ( www.3DGamestudio.com ) it is called timeStep .
In XNA Gamestudio ( creators.xna.com ) it is called GameTime .

How do I do this in Unity 3D ?
I have read something about Delta Time , but I do not know for sure, that’s why I’m asking.

By the way,Unity 3D 3.0 is a very nice piece of software that you have created.
My compliments,I’m going to hang on to this beautiful game engine.

Thanks.

FixedUpdate()

Multiply any values you’d like to increment at a framerate independent rate by Time.deltaTime.

No, that’s only for physics and is generally bad practice to use as some kind of game speed limiter. To make a game framerate-independent, you use Time.deltaTime where appropriate.

–Eric

Maybe you think it is bad practice, but he asked about a fixed time step. That is what FixedUpdate is. He didn’t ask “framerate-independent”.

He didn’t go into why he wanted to use it, nor did he ask how to use it.

Would you like to tell me how to program my applications without knowing what I am writing?

No.

That’s what he asked. FixedUpdate is the rate at which the physics engine runs. This isn’t a constant set-in-stone value. If you program all your game code using FixedUpdate, then eventually decide that physics really needs to run at a different rate, your code is screwed. Also, the Maximum Allowed Timestep would potentially make your code run slow in low framerate situations. Furthermore, if you have a relatively low physics framerate and a high framerate otherwise, then movement code in FixedUpdate would be jittery. It’s just a bad idea, period. The correct answer is to use Time.deltaTime.

–Eric

He mentioned TimeStep specifically. Yes, those things you listed are true, but they are also common knowledge. We don’t know what he wants to do, so we shouldn’t make assumptions and tell him how to do what we don’t even know what he is doing. Do you walk up to people carrying a hacksaw and some wood, then tell them they have the wrong saw for the wood? Perhaps they are two different projects? Maybe he has metal he wishes to cut at the same place to where he is taking the wood.

Anyway, to make assumptions about his plans, and then tell him the “correct answer” is arrogant. Particularly when we have no idea what he wants to do.

But yes, you’re amazing and smart, women adore you.

The Unity equivalent of XNA’s GameTime is called Time (Unity - Scripting API: Time). As eric and ender already pointed out, the specific value you are looking for is Time.deltaTime (which should be equivalent to XNA’s GameTime.ElapsedGameTime).

Nice overreaction there. The question was simple and straightforward about making the game’s speed processor independent (see the very first sentence in this thread), and the answer is to multiply the desired variables by Time.deltaTime. FixedUpdate is for physics, and the reasons for not using it inappropriately apparently aren’t known as much as they could be, or else I wouldn’t see people making those mistakes (including myself at first, before I read about it). Leaving a message that just says “FixedUpdate” in response to the topic question isn’t doing anyone any favors.

–Eric

Ok guys read carefully.
What I meant was that I want to have a consistent game speed (same game speed) on different processors.

Example :
Let’s say that I have an Intel Dual Core processor on one computer running a game at 2.2 GHZ.
I also have an Intel Dual Core processor on “another” computer which is runnng the same game at 3.2 GHZ.
Keep in mind that it is not a networked game.

Now,I want both of these computers to play the game at the same speed as possible. Even if the processor speeds are different.

I think that the Time.deltaTime is the way to go.
But how does this work actually,what does this Time.deltaTime actually do ?

With Time.deltaTime, you have a difference from the last update. So anything that is time sensitive must be multiplied by that value. It’s pretty easy. They won’t update at the same speeds, but if your math and methods are right, they will feel pretty much the same.