Object transition according to screen boundaries

Hello dear friends,

I have a small issue and I hope that you could help me. I would like to know how to make object appear on the top side of the screen, after it felt bellow some boundary at the bottom. Right now my idea is:

        if (transform.localPosition.y < transitionY)
        {

        }

I know i could simply translate object up after it felt bellow specified boundary, but then object will loose all gained acceleration (I forgot to mention that object constantly moves gaining acceleration over time). :face_with_spiral_eyes:

As well as that I would like to know how to achieve such effect: When part of object falls through the bottom boundary, that part appears on the top of the screen (and vice verse).

As always, thanks for your help.

Actually came up with quite easy solution:

       //Transition script
        if (transform.localPosition.y < transLowY)
        {
            //Translating object to the top boundary
            Vector3 transitionTop = transform.position;
            transitionTop.y = transHighY;
            transform.position = transitionTop;
        }

Still would like to know answer to my second question. :wink:

Make another camera and add it front of current camare (lower depth)
Then the the position to make sure it can see everything on top of current camera.
Set culling mask to your desire object layer only (prevent it show other object)
Then you will see object at the bottom if it go on top of current camera

And make another camera do see when object go to the bottom

Thanks, will try…