Moving An Object Slowly and Indefinitely? [C#]


I am currently working on a 2D game for a project for school in which you are jumping from one platform to the next; attempting to outpace the rising kill zone.

I am trying to get said kill zone to move up slowly and forever (until you die, of course!), but I seem to be having trouble getting it to move slow. Currently, it moves way too fast; faster than I can even see on-screen. I have tried co-routines and making the speed at which it moves up a very small number, but nothing I try seems to work.

Any help would be greatly appreciated.

Current Script:

Don’t use coroutine.
It moves too fast since you are adding speed directly to your position.

void Update()
   transform.position += Vector2.up * speed;

It’s easier this way.
Vector2.up will add 1 unit to y axis to the killzone’s current position.
Adjust your speed as desired.