Answer the question
In order to leave comments, you need to log in
How to make gradual increase in speed in unity?
Briefly about the game, flappy board with a gradual increase in speed.
For a long time I was looking for information on how to make the movement speed gradually increase, but in the end I did not find anything, so I am writing here.
Here is the code that I have now (without gradually increasing the speed)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PipeMove : MonoBehaviour
{
public float speed; // скорость для движения труб
void Update()
{
transform.Translate(-speed * Time.deltaTime, 0, 0); // движение труб
}
}
Answer the question
In order to leave comments, you need to log in
Get a class that will recalculate the speed multiplier on the update depending on the elapsed time at a given level with a public property like
public float GameSpeedMultiplier {get; private set;}
and pass this script to all PipeMode classes and multiply by this factor. Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question