hi , ive found a strange problem
my operating system is win 8 64 bit
and everything is allright when i run game in my system , but when i check my game exe in other system with win 7 or other windows , game runs faster , for example when i shoot a bullet , the speed of bullet is too fast in other computers…
please someone help me in this …
thanx alot
One of your problem is because you did use deltaTime. Take it out and adjust your constant. Something like:
transform.position = Vector3.Lerp(q0, q1, (Time.time-startTime) * 0.01);
But as I read the code, there are other issues. for example you do:
q0 = q1;
Which means that your Lerp() does nothing. Your code is equivalent to:
transform.position = q1;
My guess is that your fix will be to how you calculate c. Instead of a fixed value like 0.0045, you will use something like:
c += Time.deltaTime * 0.25;
And with this change, just remove the Lerp() and assign q1 to transform.position.
To move an object independent of framerate, try:
transform.position += transform.forward * Time.deltaTime;
DeltaTime is the time for each frame, by multiplying by DeltaTime an object will move at the same rate regardless of the framerate. By just moving by:
transform.position.x += .001;
That will move the object by 0.001 every frame. If your game is running at 60FPS then your object is moving at 0.06 every second but at 30FPS it would move at 0.03 every second. DeltaTime corrects this so that it’ll move at the same rate every time. See Docs