This tutorial could not have been more concise and to-the-point. At 20:24 I looked over at your scene view and the biggest smile just starts spreading across my face because this is EXACTLY what i was looking for. So perfect, words can't even begin to describe it. Thank you so much.
@dominiquecataquez16382 жыл бұрын
For those people having stripes in their image when offset is 1, set the wrap mode to repeat in your image.
@DmanGames Жыл бұрын
the code looks like this: mat.mainTexture.wrapMode = TextureWrapMode.Repeat;
@AustinTJanzenАй бұрын
Bless you
@donloh74546 жыл бұрын
2017 - set the wrap mode repeat to work well ;)
@eliahreeves37395 жыл бұрын
thanks
@ukrainecmk5 жыл бұрын
Thnx :)
@chiperchiper17825 жыл бұрын
what is wrap mode?help me please my texture rendering bad
@happym0nk3y5 жыл бұрын
@@chiperchiper1782 wrapMode is a property on the texture, you can set it in code with 'material.mainTexture.wrapMode = TextureWrapMode.Repeat;'
@PauloHenrique-jr7ir5 жыл бұрын
Ahh you are my hero, man!! Thanks, wasn't able to find the solution! 🤜🤛
@MooseyGaming10 жыл бұрын
'relatively quick tutorial' - 26 minutes :D always seems to be the way!
@muddro42010 жыл бұрын
only one part
@moosesnWoop4 жыл бұрын
Thought it would be like 4 mins lmao but for this type of effect and build it's actually really concise
@eugenekalnitski15175 жыл бұрын
Thanks! Works even 5 years later on Unity 2019.2.5. Helped me a lot.
@mosysaurusrex5 жыл бұрын
same here!
@notpaul96378 жыл бұрын
Love the effect this made. Sure there may be an easier way to do this but it is so light and easy enough it can be added to a project pretty quickly.
@wigwam4you4 жыл бұрын
Thanks! Quick Tip for using this with LWRP / URP (Unity 2019.3.15f1) - The mainTextureOffset Property does not seem to work properly, since the new value is not set and the texture does not move. The offset must be accessed via the the Methods material.GetTextureOffset("_BaseMap"); and material.SetTextureOffset("_BaseMap", offset);
@adambenk04 жыл бұрын
I have spent literally 3 hours wondering in agony, why it is not working......Thanks mate, you just saved my sanity.
@DHofmann8 жыл бұрын
Very intuitive and at the same time easy to follow.Best understandable tutorial on this effect I found on KZbin so far.
@StraightTomahawk4 жыл бұрын
Fantastic video, all these years later it's still helpful!!
@nfenton9 жыл бұрын
I had been trying to get this to work for a few hours and then came across your video. Thank you so much!
@gabsdonati2 жыл бұрын
OMG THANK YOU! Been looking for something like this, but can`t find anything on it. Especially something recent! Who would've thought that a KZbin video from 2014 would still be THIS RELEVANT! Amazing, great job! Efficient Easy Timeless
@wgw410 жыл бұрын
Loving the fact that you put up more content on this channel! Keep it up!
@jennysun46657 жыл бұрын
Thank you so much with your tutorial. I actually couldn't find a good infinite scrolling tutorial for both horizontal and vertical. Your tutorial helped me a lot with creating my game for my assignment. Thank you so much! Keep up the great work!
@julezgermany58394 жыл бұрын
2020 - still works well :) "set the wrap mode repeat to work well" -Don Loh 2017 Thanks mate!
@lucas90gs4 жыл бұрын
How did you manage to apply a Sprite to the Material?
@zuzieeeeee2 жыл бұрын
I've been searching hours for exactly this
@tonyfweb Жыл бұрын
Fucking legend! I've been breaking my head for the last two weeks to get this very effect and hadn't been successful. I even opted to ask ChatGPT and it wasn't understanding me. I can't believe this video is so old yet so useful. It's late so I won't be trying it till tomorrow but holy shit. You are my god damn hero!
@AlSamZar7 жыл бұрын
That's why I fell in love in game development, you get to engineer your solutions like this, I hope I have your expertise someday ! thx a lot for this.
@PixelMake6 жыл бұрын
Hi Alaa we have some free ships and asteroids and other assets for your games on our channel & tutorials best of luck with your project. if you do decide to use our stuff we would love to see your creations tweet or message us on facebook Instagram . stay awesome!
@theral0569 жыл бұрын
Awesome tutorial. Looks like something basic, which I had no idea how I would solve, explained to me in 26 minutes and easy to replicate for great effect. Awesome!
@theycallmemrglass5 жыл бұрын
wow, this tutorial turns out to be so much more than just a scrolling background! You should have called this "How to build the core element of a Parallax Scrolling Game!" - I am suddenly having a urge to develop an R-Type game...ah memories.
@lehula8 жыл бұрын
This is exactly what I was looking for. You also did the parralax effect. Next beer is on me!
@alexleonardi27 жыл бұрын
This is an absolutely AMAZING tutorial! Thank you so much! The parallax effect was awesome! You are great
@VergilxUA10 жыл бұрын
Lovely tutorial, quite enjoyed the solution for this type of parallax effect
@ruzzyshuya48328 жыл бұрын
Cheers Quill. I just got Unity and making some things to go along with your simple space shooter tutorial and this fits right in with my idea :)
@Kamus19526 жыл бұрын
How to make it as a background. It cover my UI elemtns, which are not visible.
@QuotenLP9 жыл бұрын
I have a problem with it: My offset is not infinitely. For example if I change my Offset to 1 the texture is gone. I also use the unlit shader but its also not working on all of the others. Please help me.
@cristhiandiaz36839 жыл бұрын
+Tim Lange did you fix it?? I have the same problem
@iskandarshabaev9 жыл бұрын
+Cristhian Diaz in texture settings: Wrap Mode = Repeat
@colbymaulden73579 жыл бұрын
+Iskandar Shabaev i have the same problem, but it still does the same thing even after changing the wrap mode to repeat
@QuotenLP9 жыл бұрын
Colby Maulden Setting wrap mode to repeat fixed it for me. Thanks a lot!
@a.c.bonneville1898 жыл бұрын
thanks bro
@andythayer54934 жыл бұрын
Great video. As always, Quill18 vids show the way (at least to us amateurs).
@jedrzejwysocki55843 жыл бұрын
EXACTLY what I needed. Plus very informative. Good job, sir!
@noreasonchannel40126 жыл бұрын
its 2018and still the best...Amazing! Keep making more!
@cheshire_cat_31110 жыл бұрын
That parralax was such a great feature
@trashgamedev Жыл бұрын
a bit long-winded but a great looking effect that's simple to make, thanks a lot!
@gregmumbai33310 ай бұрын
This is obviously a very old video but it was helpful for jump starting a few ideas for me. If anyone wants to decouple the camera from the player but still have the option of tracking the player with the camera you can try this: Make a follow script and attach it to the camera and then feed in the position of the player as a vector and move the camera using a lerp function: trackingPosition = player.transform.position; transform.position = Vector3.Lerp( transform.position, trackingPosition, trackingSpeed * Time.deltaTime ); trackingPosition is the player position modified so they don't end up totally on top of each other and the ship is positioned in frame: trackingPosition.z = trackingPosition.z - 10; Then you can also create a bool to turn the tracking on and off and put it in a function so you can switch between a fixed camera and a tracking camera. Not sure if that is useful to anyone but it's where my mind went. Also, there are probably better ways to do but it works as a starting point.
@KyleRebstock6 жыл бұрын
This is better than I was looking for. It's a bit old though and I kinda expect things to be different now, which I will probably be able to figure out the rest. Nonetheless awesome video!
@hamilaibrahim41715 жыл бұрын
I got white lines after moving some time help me
@jok56433 жыл бұрын
Wow suuuuch a great tutorial! Tip* for newer versions of unity use "default" for the texture image
@nileriversoftware40703 жыл бұрын
A plane could potentially use less resources if it is very large, and only part of it is visible. Unity might have better occlusion culling when the square is divided up into more polygons.
@Pinkhair3d10 жыл бұрын
There's an even easier way to handle it- put on a shader that uses world coordinates for the UVs and make the quad the child of the camera, and it will always match perfectly for any speed or rotation with no particular scripting.
@quill18creates10 жыл бұрын
Shaders are scary.
@mystirboy8 жыл бұрын
Life saver! I've been trying to figure out how to implement a parallax with an infinite background and my solution was just to object pool the background but really messed up my parallaxes.
@aztecGin4 жыл бұрын
Wow sir, it is amazing. You just ruined my work moral for today, I want to go home and try it on my spacecraft project. Woha that tweak in the end would highly improve my game UX. Love it! :D
@Sicklymade10 жыл бұрын
thanks for this! was trying to copy your dig game you made for lundum dare and create/destroy quads as you moved. But this is soooo much more lightweight. Thank you :)
@dorondavid46985 жыл бұрын
This was extremely clear and very well explained... Great job!
@MadDeuceJuice7 жыл бұрын
the parallax effect makes it look like you're going at many multiple times the speed of light
@programer133710 жыл бұрын
Congrats!!! Great tutorial. I was wondering if some times in the (I hope) near future you could do a tutorial with some gravity tricks. For example gravity points where you in game create an attack and create that point and pull all near objects to it and it explodes dealing some damage or something like that. Gravity is really usefull and it would be great to have one great tutorial as all of your tutorials by now :)
@justincudney262710 жыл бұрын
To do that you can just use bits of this tutorial and the space game tutorial, combine it together and you get a top down RPG
@Oxmond4 жыл бұрын
Oldie but goodie! Still a really nice tutorial 👍🤓
@ProximaS4 жыл бұрын
remember change Wrap mode in Texture to Repeat*
@Ami-Wishes10 жыл бұрын
Thanks for this, and all tutorials you do haha. Also, I can't wait to get Unity Pro. It's gunna be so great
@MattMajcan Жыл бұрын
did everything right but when in the actual game it just turns black
@bandolero8189 ай бұрын
Hey! Many thanks ! Love the effect and you explained so well. Good luck!
@atirathk8 жыл бұрын
At 11:49, why doesn't the program work if you merely type float scrollSpeed = 1.0f mat.mainTextureOffset = offset * scrollSpeed with the scrollSpeed increasing every few seconds by 0.1, why doesn't the program work?
@niwhalegaming3 жыл бұрын
hey nice video but when im moving my shader offset, my texture don't repeat, i get a color only, why ?
@vibehub50053 жыл бұрын
I’m having the same issue did you figure out how to solve this?
@Venky.Arisko7 ай бұрын
how to fix if ship rotate, background rotate too?
@baconmanbacon3034 жыл бұрын
after i get the material loaded the way u say I hit the play button and when it starts insted of a continues stars I get a look the looks like u are streching the lat row of stars out like spagetti any resone whay this is happening???
@jocopowell3 жыл бұрын
Could you use the same Starfield images, but flip one, to eliminate the blurry effect?
@Dave-xp3xg4 жыл бұрын
hey how do you make it go scroll vertical?
@aussiedev593010 жыл бұрын
awesome as always, mega space game 3d v1 here I go. Great tutorial Quill,
@DieEineTomate8 жыл бұрын
Hey, what if i dont want to parent the Cam directly to the spaceship? I can't figure out an solution... couldt you help me please?
@maykefernandesdossantos73742 жыл бұрын
When comes down to performace is this approach better than having multiple background been intantiated and excluded like in the unity official tutorial?
@JohnSmithULIR08 жыл бұрын
Another thing, if I want to create an infinite scrolling background for a 2D project, will a Quad work as well? or do I have to use another Object?
@mikhailharris84807 жыл бұрын
Hey mate, i'm trying to use it in 2d Unity but for it only work vertically if i fly my spaceship upwards, when turning the starfield seems turning but my spaceship stays vertically(static). LOL
@HeraxMimar Жыл бұрын
When i change the diffuse it turn into pink. Help please
@kianheus24879 жыл бұрын
I have a problem. Whenever i create a new material, the shader is set to standard, and I can't figure out how to change it to diffuse. HALP!
@igd15913 жыл бұрын
Still a cool tutorial in 2021!
@aspenmallery7 жыл бұрын
I'm interested to see how you'd implement this method in a 3d enviroment with planets and other models. It seems like this would work best for platformer or top down shooters. I wonder if you could apply the same technique to a starey skybox for real 3d stuff
@aussiedev593010 жыл бұрын
I worked out how to change the default Monodevelop script file so you can have it formatted how you like as a default. Just go into your Unity-installation-folder and navigate to "/Editor/Data/Resources/". There you will find all templates. Copy and paste the file in another directory so you can edit the file. Change the contents how you like, then save and copy and paste back into the "/Editor/Data/Resources/ folder. It would not allow me to edit the file in Program Files even with Administrator privileges, that's why I copied the file into another folder then edited it. I hope this helps :)
@colbymullenix91407 жыл бұрын
excuse me, but is it possible to apply parallax scrolling to scaling and rotating an object? For example, when you move up on the Y-axis, the texture moves forward, but when you move either left or right on the X-axis the texture rotates left or right respectively.
@TheNamesJT5 жыл бұрын
I think the space game nova raider does this effect, but they have planets and other things in the background too
@gluedtogames9 жыл бұрын
Can you use this for an sidescrolling endless runner, but set the parallax effect to only work on the x position?
@IlIamo2 жыл бұрын
Wow, thanks alot. This was exactly what I was looking for dude
@virendrabhoriwal4266 жыл бұрын
Hi Sir, Could you please help me out in changing background at runtime during background scroll. What I wanna to show - during scrolling background, I need attached scrolling i.e. one texture comes after another and continue to scroll with 2nd background. Sorry for bad english. I hope you got my point. Please help.
@stevencardwell461610 жыл бұрын
would it be possible to make a particle emitter emit on keypress only like for moving in z axes ? thanks
@kooky216films510 жыл бұрын
I'm using the BG to scroll down over time, works great. I need to move the camera horizontally using player input (like an old shmup) and i'm stuck!
@rkpixeldesign6 жыл бұрын
Great tutorial exactly what I was looking for thanks.
@pnvgordinho9 жыл бұрын
Hello, Can I ask a question that maybe stupid?. I don't know much of unity and I was wondering if the particles system can emite different sprites like 2 stars with different colors?. Thanks.
@suppermanzzzz2918 жыл бұрын
That exactly what i want, thank you to share the idea
@petertodorov55924 жыл бұрын
i dont know how to start - how to import my texture as a texture and how to make it so my 3d game is 2d :/
@victorvlugt77914 жыл бұрын
Thank you!! Using this to make the menu in my among us 3d. Also implemented parallax, which is pretty easy to do by using mutliple layers and giving them a different speed.
@yashwanthd19984 жыл бұрын
Tried whole day getting that effect in 2d.does it work in 2d.pls rly
@teckset58214 жыл бұрын
the y coordinate doesn't work for me can anyone help me
@CorruptedNuk3r10 жыл бұрын
Can you make a tutorial for how to add a text-chat?
@JonathanGorr9 жыл бұрын
Hi Quill. Great tutorial! Do you know how this method can be applied to textures that are also moving on their own- say comets or astroids?
@cristhiandiaz36839 жыл бұрын
when I increase the offset number it moves but the img is completely black in the space I moved any ideas???
@achmedauditguy22718 жыл бұрын
I might be a bit late :-) Go to the texture and set the WRAP to REPEAT (instead of CLAMP). Should fix it.
@gjergjkadriu94602 жыл бұрын
8:44 material ✨
@budnicholson110 жыл бұрын
i cant get it to scroll i did everything the way you did but cant get it to do a thing
@mikhailharris84807 жыл бұрын
Not work with 2d Unity. the star seems good when go vertical/-vertical, but when i want to turn my spaceship it won't turn but the starfield background move according to my turn. Really need a PRO here, cuz im so noob in scripting. lol
@exstraninja76475 жыл бұрын
My quad just rotates sideways so it's stuck there forever
@videomasters246810 жыл бұрын
awesome tutorial, really made me want to make a parallax scrolling game :)
@humbertomatias9 жыл бұрын
Do you have any game so I can download on Iphone/ipad/steam? I mean, I love your videos and I'd love to download some of your work.
@gooball6 жыл бұрын
I was fearing for my life these last few days thinking of how I was going to do this. Making a infinite background with objects in new positions after moving out of the screen was already problematic with making a flappy bird game. But this.... THIS!... this made me go: "hwhawt, this is possible!? This is genius!" Thank you, kind Sir, you saved me... lots of hours of hair pulling and teeth grinding.
@entitydotexe61383 жыл бұрын
Just what I needed. Unfortunately, you're adding too many details to the video so it took me quite too long to comprehend the essence
@stevencardwell461610 жыл бұрын
thanks for this amazingly creative solution nice one keep them coming.
@alexanderwilson56595 жыл бұрын
exactly what i was looking for, ty.
@Rajenp06 жыл бұрын
Amazing video, subscribed! But one question, why doesn't this work very well for mobile devices, the background is very slow and choppy?
@ImD3VI4 жыл бұрын
very informative and easy to follow.
@BeAltyrnative8 жыл бұрын
mine pulls the stars and stretches them across the screen, looks very weird instead of scrolling, help would be appreciated
we have some free ships and asteroids and other assets for your games on our channel & tutorials best of luck with your project. if you do decide to use our stuff we would love to see your creations tweet or message us on facebook Instagram . stay awesome!
9 жыл бұрын
reference behavior missing?
@sebsunda10 жыл бұрын
You sir, are a mad genius!
@ZeroChronicles014 жыл бұрын
This does work ! how ever! If your ship is aiming like a twin stick shooter, the camera will go crazy. still looking for a fix, ill update my comment if i do find one, but i wanted to let people know
@shavais332 жыл бұрын
Awesome tutorial! This is almost exactly what I want.. but not quite. I don't want layers. I want each star to have its own distance and type. I have a GLSL shader program (a combination of a vertex and a fragment shader) that I wrote for an OpenGL C++ program I wrote that creates a starfield like this that moves around based on a camera position, in which each star has it's own x,y position, z-distance, and type. The vertex buffer passed to the shader has an x,y position, a z-distance, and a star type. The fragment shader renders a point sprite that is selected from a small atlas based on the star type. it works great for my purposes, except, well... I haven't learned how to program coded shaders in Unity yet. It's kind of a barrier for me at the moment. =(
@brettsullivan402510 жыл бұрын
why dont you just call it a base mesh instead of a mesh filter?
@GregamoNintendo2 жыл бұрын
Amazing video, thank you so much!
@devendergupta_official8 жыл бұрын
how to make a paragraph scroll up automatically and repeatingly?
@1K1NDR3D8 жыл бұрын
paragraph lol
@PixelMake6 жыл бұрын
we have some free ships and asteroids and other assets for your games on our channel & tutorials best of luck with your project. if you do decide to use our stuff we would love to see your creations tweet or message us on facebook Instagram . stay awesome!
@Thezaccazzac10 жыл бұрын
not to complain, but the download for this file does not seem to work. btw great tutorial really informative and to the point :D
@Thezaccazzac10 жыл бұрын
***** yeah still says: ___ Not Found The requested URL /unity_tutorials/Infinite Scrolling&20Tutorial.zip was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. Apache Server at quill18.com Port 80 ___ but this was what the problem was before so it's still broken sadly...