I increase the scale of the objects when it passes a certain time or in this case, my “difficulty”
//Spawn Size
float spawnSize = 8;
void Update()
{
if (Time.time > nextSpawnTime)
{
float SpawningInBetween = Mathf.Lerp(spawnsMinMax.y, spawnsMinMax.x, Difficulty.GetDifficultyPercent());
print(SpawningInBetween);
nextSpawnTime = Time.time + SpawningInBetween;
if(Difficulty.GetDifficultyPercent() > 0.7f)
{
fallingRockPrefab.transform.localScale = Vector2.one * spawnSize;
}
Then as expected, the object increases the size after it passed that conditions so i want to revert back to its previous state so i remove:
if(Difficulty.GetDifficultyPercent() > 0.7f)
{
fallingRockPrefab.transform.localScale = Vector2.one * spawnSize;
}
but when I saved it and go back to unity, the object still in its “increased” size right at the start. What’s happening?