How to make a sprite coming towards us from far away in 2D ?

As an example, if we get the black box sprite I just wanted to make it move towards us by changing Z Position. But it doesn’t work as it doesn’t make any change if I change Z Position value.

Can you help me to do this ??

I want to initialize these type of 2D sprites randomly and make it move towards us like in a space travel scene

You need to change your camera to perspective.
It will still work for your 2d Sprite but the effect you are looking for will then be visible. You could just have an orthographic camera in this scene or for your entire game. It will give it a different feel. You see for yourself.
You could also do like the other guy said in changing the scale but the object isn’t getting bigger insults getting closer. So i think this will be more of want.

Let me know… :slight_smile:

Hi there!
Depth doesnt work in 2D because you work with what is called an ortographic view. Moving along rhe Z-axis can be very useful for sorting background and foreground objects, but in order to make things smaller you’ll habe to rescale the X and Y axis equally.

Tl;dr: Use X and Y scale.