- Home /
speed change in standalone compared to editor?
Hey, in my game there are gameobjects that move through script:
if(transform.position.x >= 9.5 || transform.position.x <= -9.5)
{
transform.position = Vector3(transform.position.x,drop,transform.position.z);
speed = -1 * (speed * 1.1);
}
///
transform.Translate(Vector3.right * speed);
///
var speed = 0.5;
now thats all fine and dandy but when I export my game to a desktop version the gameobjects move way way faster, is this something to do with time.deltatime and how do i fix it?
Answer by Eric5h5 · Feb 27, 2011 at 04:48 AM
Your code is framerate-based, so it will run differently at different framerates. Make it time-based instead; the docs explain it. http://unity3d.com/support/documentation/ScriptReference/Time-deltaTime.html
Your answer
Follow this Question
Related Questions
Game over scene when the time is up ? 2 Answers
increasing speed and time of spawn game object 0 Answers
Different behavior between editor and standalone changing time step 0 Answers
Reset speed after a specified time 0 Answers
Time.deltaTime problems? 1 Answer