- Home /
Movement speed difference between the different devices
I just making a ball game with Unity, but in every device (android) the speed is different I read some docs about Timedelta but I understand nothing. could you please describe me how can I stabilize the speed in every device? here is my script.
#pragma strict
var Right = 30;
var Left = 30;
var LeftButton : GUITexture;
var RightButton : GUITexture;
function Awake () {
LeftButton = GameObject.Find("LeftButton").guiTexture;
RightButton = GameObject.Find("RightButton").guiTexture;
}
function Update () {
for (var touch : Touch in Input.touches)
{
if (touch.phase == TouchPhase.Stationary && LeftButton.HitTest (touch.position))
//if (Input.GetKey("left"))
{
rigidbody.AddForce(Vector3.left * Left) ;
}
//if (Input.GetKey("right"))
if (touch.phase == TouchPhase.Stationary && RightButton.HitTest (touch.position))
{
rigidbody.AddForce(Vector3.right * Right) ;
}
}
}
Comment
Best Answer
Answer by SkaredCreations · Mar 22, 2014 at 10:51 PM
Multiply your forces by Time.deltaTime, for example:
rigidbody.AddForce(Vector3.right Right Time.deltaTime)
Your answer
Follow this Question
Related Questions
Increasing the speed of an object when the scale is decreased and vice versa 0 Answers
2D Vector Movement,Vectorel Movement with Buttons 2 Answers
Detecting Vector3 Movement speed. 2 Answers
My Character is moving fine horizontally and vertically, but moves way too fast diagonally 2 Answers
Animate Character movement? 1 Answer