Unity 2D: Scrolling Background

  Рет қаралды 19,474

Root Games

Root Games

Күн бұрын

Learn how to make a scrolling background for 2D games in a super easy and simple tutorial.
✅ Get my courses with discount:
👉 Unity 2D Master: www.udemy.com/course/unity2dm...
👉 Unity Mobile Course: www.udemy.com/course/unitymob...
👉 Unity Input System with Rebinding: www.udemy.com/course/unity-in...
👍 Save your time and learn Unity faster
-------------------------------------------------------
🔔 Subscribe for more awesome content:
🔴 / @rootgames
-------------------------------------------------------
🟡 Support this channel through donations
Any amount means a lot and will help grow the channel:
👉 PayPal: www.paypal.com/paypalme/rootg...
-------------------------------------------------------
Social Networks:
⭐ Instagram: / rootgamesofficial
⭐ Twitter: / rootgamescro
⭐ TikTok: www.tiktok.com/@rootgamesoffi...
⭐ Facebook: / root-games-10337038860...
-------------------------------------------------------
#unity2d #unitytutorial #unityscrollingbackground #rootgames

Пікірлер: 37
@Roadkill601
@Roadkill601 Жыл бұрын
I started with like 5 other videos that did everything but get to the point. Thank you. Worked Great!
@dickvanthoff
@dickvanthoff 8 ай бұрын
For those wanting the scroll to be an the Y axis, this code works for that: bgRenderer.material.mainTextureOffset += new Vector2(0, Time.deltaTime * speed); When doing "bgRenderer.material.mainTextureOffset += new Vector2(speed * 0, Time.deltaTime);" the scrolling did work for me, but the speed float did not affect the speed. Thank you for this video!
@annaliese303
@annaliese303 2 ай бұрын
if anyone's having trouble with layering their background images make sure the material is set to unlit>transparent cutout. i couldn't see the layers behind my front layer at first but this fixed it!
@lukechaney3718
@lukechaney3718 2 ай бұрын
I'm having an issue where the other backgrounds are getting distorted over time idk why
@plutus9274
@plutus9274 Ай бұрын
I've been searching for this solution for the past hour tysm
@ZabawneGierki-ot3ts
@ZabawneGierki-ot3ts 4 ай бұрын
Thanks, the other tutorials didn't work for me, but this one does!
@RootGames
@RootGames 4 ай бұрын
Glad it works for you!
@AK19204
@AK19204 4 ай бұрын
Excellent tutorial, it went straight to the point and it was easy to follow. Thank you for making this!
@emindemir6659
@emindemir6659 2 ай бұрын
This was what I exactly wanted. Thank You!
@Bergdwerg123
@Bergdwerg123 Жыл бұрын
Thanks, works like a charm.
@abbbab
@abbbab Жыл бұрын
goated tutorial
@21CenturyBreakdownX
@21CenturyBreakdownX 2 ай бұрын
Works great for a level that has a very consistent background. This might work for my far back background, but in order to stitch together different stages of the level (basically just change how the road the car is driving on looks when i reach the boss) I don't see how this could be used? Is there a technique to feed in a new texture during run time without it rapidly switching texture?
@dcry1003
@dcry1003 2 жыл бұрын
Omg! And just an hour ago i was thinking of changing how my background works cuz i just attach an image of the background i made into the camera and change the position so it wont block other objects🤣 thank you very much!
@splityTheMonkey
@splityTheMonkey Жыл бұрын
how do you make it not block stuff i cant find out?
@Mamaco915
@Mamaco915 9 ай бұрын
to the point thx for this :DD
@RootGames
@RootGames 9 ай бұрын
My pleasure 😉
@peterpahn8705
@peterpahn8705 11 ай бұрын
the only real way lol thank u dude
@RootGames
@RootGames 11 ай бұрын
No problem 😉
@SeanWonder
@SeanWonder 9 ай бұрын
Awesome tutorial but where can we find the Scrolling Background script that you used? Should we just copy/paste this?
@RootGames
@RootGames 9 ай бұрын
Hi! There is no script to download, just copy a few lines of code you see in the tutorial 😀
@varjasib993
@varjasib993 Жыл бұрын
Done as in the video, but as I used it it became significantly darker in color, any hints why, or how to brighten it?
@kevjn1000
@kevjn1000 Жыл бұрын
did you set the material's shader to unlit/texture?
@sete5721
@sete5721 2 жыл бұрын
Can I use sprite renderer instead of mesh renderer?
@RootGames
@RootGames 2 жыл бұрын
No with this approach.
@sete5721
@sete5721 2 жыл бұрын
But sprite renderer can also have materials.. Is there any difference in perfomance or something? Sorry for keep asking.. I'm noob here
@RootGames
@RootGames 2 жыл бұрын
@@sete5721 Actually, I had done something wrong when testing it. You can do it with Sprite Renderer.
@sete5721
@sete5721 2 жыл бұрын
Thank you! I'll give it a try later ☺
@Littlelavishtoo
@Littlelavishtoo 5 ай бұрын
can you give a tutorial and full source code of space shooter game
@RootGames
@RootGames 5 ай бұрын
Hi! Unfortunately, that tutorial is an old and unfinished project. I don't have it anymore.
@Mikaela112
@Mikaela112 Жыл бұрын
how would I make it scroll down?
@JOMHDev
@JOMHDev Жыл бұрын
to make the texture scroll down you want the material to offset downwards (on the Y axis) so all you need to do is just flip the two values in the vector2. remember to also make it negative so it goes down instead of up!
@SeanWonder
@SeanWonder 9 ай бұрын
@@JOMHDevI’m unsure what you mean here and I’ve been dying to get my vertical scroll working. The Vector 2 here says (speed * Time.deltaTime, 0); How are we supposed to flip those 2 values? Or do you mean the values in the transform section there in the inspector making X 18 and Y 32 instead? Sorry I’m a beginner here
@JOMHDev
@JOMHDev 9 ай бұрын
@@SeanWonder i forgor the context, but vector2 takes two values (x,y) and if x = 2 and y =1 for example, you should make x = 1 and y = 2. Flipping the values.
@dickvanthoff
@dickvanthoff 8 ай бұрын
@@SeanWonder for me the speed float didn't do anything when I simply did (speed * 0, Time.deltaTime), it worked when I did (0, Time.deltaTime * speed).
@helderdaniel1563
@helderdaniel1563 Жыл бұрын
it is not needed a 3D object, can be used A 2D object like a square.
@RootGames
@RootGames Жыл бұрын
You can do it with a sprite renderer and 2d object,BUT Unity will give you a warning that it shouldn’t be done like that because the sprite renderer is not designed for this and it can lead to unwanted behavior
@lokepuisan2456
@lokepuisan2456 Жыл бұрын
It really helps me a lot, thanks!
Unity Beginners - How to Loop the Background Image
9:24
Adamant Algorithm
Рет қаралды 24 М.
Parallax Infinite Scrolling Background in Unity
17:11
Code Monkey
Рет қаралды 146 М.
КАКОЙ ВАШ ЛЮБИМЫЙ ЦВЕТ?😍 #game #shorts
00:17
Pray For Palestine 😢🇵🇸|
00:23
Ak Ultra
Рет қаралды 35 МЛН
Как быстро замутить ЭлектроСамокат
00:59
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 12 МЛН
WHY IS A CAR MORE EXPENSIVE THAN A GIRL?
00:37
Levsob
Рет қаралды 17 МЛН
Unity: 2D Shooting
4:17
Root Games
Рет қаралды 46 М.
Unity 2D PARALLAX EFFECT Tutorial | Endless Scrolling Background
6:55
Making a Background BEAUTIFUL (My full process)
8:01
Lost Relic Games
Рет қаралды 93 М.
I tried coding my own graphics engine
4:23
Garbaj
Рет қаралды 184 М.
How to make 2D GLOW in Unity!
15:56
Brackeys
Рет қаралды 582 М.
5 Minute DIALOGUE SYSTEM in UNITY Tutorial
5:11
BMo
Рет қаралды 147 М.
SCRIPTABLE OBJECTS and EVENTS in Unity
6:46
Root Games
Рет қаралды 2,8 М.
How to make Infinitely Repeating Background in UNITY!
5:25
Ghost Studios
Рет қаралды 10 М.
КАКОЙ ВАШ ЛЮБИМЫЙ ЦВЕТ?😍 #game #shorts
00:17