Unity 2D - animated background

33 Views Asked by At

I'm working on a game with free pixel adventure sprites. The GIF below is a level that the sprite creator put, and I have no idea how to create such a background in Unity (repeat with go down animation).

Background sprite Also added in the end of this post.

Game

Sprite

2

There are 2 best solutions below

1
Ali Bendaoud On

The idea is that you should switch the wrap mode of the sprite to repeat, add that sprite to the material of the 3d object background, and add a script to the background that has access to the mesh. Here is a video that addresses the issue. It is 3 min long. https://www.youtube.com/watch?v=c4r4Ul6QrFg. Let me know if you have any questions!

0
Shubhz On

You can achieve this same effect with just a shader too, make a big quad put that texture mode to repeat and change the uv coords with time, if u want vertical movement add the uv's y component with time it will just achieve the same effect much optimized ..

if u want i will provide u with a basic shader that does that :)