Unity 2D Parallax Background Effect in 100 Seconds

preview_player
Показать описание
Let's learn how to make parallax background effect in unity 2d in less than 100 seconds, no coding necessary!

If you get stuck, you can ask for help on our discord server! Join through this link:

PasteBin Links:

-----

GitHub Gist Link:

-----

2D Platformer Art Pack:

-----

Instructions:
1. Download the parallax system scripts and import them into your project
2. Create a new game object and name it "Level"
3. Add all of your layers as children
4. Attach the ParallaxLayer script to all of your layers
5. Set the values so that the mountains in the back are positive values, increasing the farther they are from the camera... and the foreground elements and increasing negative values the closer they are to the camera
6. Attach the ParallaxCamera component to your camera
7. Attach the ParallaxBackground component to your Level game object that we created earlier.
8. Enjoy your new parallax scrolling background effect in your game!

If you have any questions post them in the comments and I'll do my best to answer them.

If you enjoy this type of content please consider liking and subscribing!
Рекомендации по теме
Комментарии
Автор

bro didn't even bother to explain what the code does, he just joinked the .cs into his project...

zaglossus
Автор

That.... was indeed straight to the point. I have to adapt it a little cause my game is weird, but the script is clear enough that it was easy to make that shift. Thank you!

srogue
Автор

This video is gonna be useful, although I find it funny you say you explain it in 100 seconds even though the video has 1 minute 😅

patildo
Автор

great vid.
Small question say you have 1 layer that needs to move constantly in on direction how would you add that to the current scripts?

RafaelAzriaiev-kvqm
Автор

Bro u solved the big prob of mine directly to point u gained my sub ✌🏻 keep up the good work man

OmParkash-gyug
Автор

Haven't tried it yet but I subbed immediately...

mmm_mmm
Автор

thank you but what value should i put if i want the layer to completey follow the camera? to completely stuck in the same spot?

eladperi
Автор

Why this channel don’t have more suscribers? Great content and quality 👍👍

BustamanteRoberto
Автор

is there some video that explains the logic behind the codes? thx

MilchoMalefic
Автор

You helped me use my time with efficency, of course i'm subscribing! ;)

GabCom
Автор

awesome even if am not using unity this is a good logic tutorial

smokeback
Автор

Thanks for showing this, I tried your scripts and they work great so far. Any reason why they only move in x though? I just altered your script a little to move things in x and y

RogueSnake
Автор

Question: when designing custom art for such backgrounds/platforms - How do you size it correctly? … Would you create the blank map & then draw/paint over a screenshot in Photoshop?

SadTown
Автор

Thank you very much :) but how can i do to do a parallax (axe Y) ?

LionelArt
Автор

does this still work?, didnt work for me, all the images are in front of the level

karamel
Автор

how can i loop this background objects?

yasinalbayrak
Автор

Thank you so much. Can I apply your code to my game and use it commercially? I'm curious about the copyright instructions!

turtlecrane
Автор

does it still work if there's another script component in main camera?
I have a camera shaking script attached to my main camera

VintagesoUltree
Автор

Brother, what is the name of your software? And is it support corei3 or better regulation will take pc?

wahidulsagor
Автор

Thank you! and could you tell me how do you draw long smooth collider edge for the ground?and how to avoid the height difference of sprite because my character often gets stuck😥

Visionary-qsuu