Hello… I want to ask a double questions about unity 3d. I am creating cubes ıt is moving to the left. I want to acceleration with time. For isnstance this cubes reach a maximum Velocity.
private float timer ;
// Use this for initialization
void Start ()
{
}
// Update is called once per frame
void Update ()
{
timer += Time.deltaTime;
if (timer < 10) {
velocity = velocity + timer;
transform.Translate (Vector3.left * velocity * Time.deltaTime );
Destroy ();
-
My second questions is ı am creating a system using with Time.DeltaTime like that
if (Input.GetKeyDown (“w”) )
{grounded = false; transform.rigidbody2D.AddForce(Vector3.up * velocity / Time.deltaTime); }
But time.delta time changeable so my game is not stable. How can fix and stable my timer?
The objects moves sometimes fast and sometimes slow…