I have been using addforce with my rigidbody but realised that on slower computers, you won’t get the same force. I then tried to impliment Time.deltaTime with my addforce script but the rigidbody then started moving really really slow in the game and had terrible acceleration. I don’t know what to do. Here is my script:
var maxVelocity : float = 5; function FixedUpdate () { if (Input.GetKey ("down")) { rigidbody.AddForce (Vector3.forward * -0.2 *
Time.deltaTime);
}if (Input.GetKey ("up")) { rigidbody.AddForce (Vector3.forward * 0.2 *
Time.deltaTime);
}if (Input.GetKey ("left")) { rigidbody.AddForce (Vector3.left * 0.2 * Time.deltaTime); } if (Input.GetKey ("right")) { rigidbody.AddForce (Vector3.right * 0.2 *
Time.deltaTime);
}var velocity = rigidbody.velocity; if (velocity == Vector3.zero) return; var magnitude = velocity.magnitude; if (magnitude > maxVelocity) { velocity *= (maxVelocity / magnitude); rigidbody.velocity = velocity; } }