(Unity 2D C#) Move instantiated prefab on Y axis?

Hi, To get straight to it, How can I move an instantiated prefab on the Y axis? I’ve been trying some to use AddForce() and transform.Translate(0, 1, 0), but for some reason they’re not working.

Here is my script to instantiate the prefab…

void scrollBackground()
	Debug.Log("Moving object...");
        //To move prefab
	obstacle.transform.Translate (0, 1, 0);

How can I fix this?

That is correct code. One thing you can try is check if the object is rotated - you could just be moving the object away from the camera since Transform.Translate works in a local space by default. Try and confirm this by looking at the scene view in-game.

To force Unity to translate on a global scale, do this:

obstacle.transform.Translate (0, 1, 0, Space.World);