Revisiting 2D Parallax Scrolling Backgrounds in Unity

preview_player
Показать описание
This is a quick video I made to clarify some of the elements of my previous video while expanding on the concepts.
Рекомендации по теме
Комментарии
Автор

A tip for doing the infinite scrolling with a parallax effect (so infinite parallax scrolling). Basically set the the 'speed' variable to be the rigidbody2D.velocity.x in the player object and divide it by a 'smooth' variable. If the 'pos' variable goes below zero, then add 1f to it. Same thing can be done for 'y' velocity; you can add multiple planes with this script, each with a different 'smooth' variable (the larger it is, the slower it scrolls). It makes for one amazing and efficient effect.

kyrenity
Автор

Thank you, I was using a very complicated method to do this kind of effect. You sir have saved me some time. 

julianspring
Автор

My background pops more their yours does when I change my direction.  How do I fix this?

jcastaldo
Автор

When i change the camera to orthographic all my sprites start distorting below the platforms and things keep stretching or shrinking, how do i fix this.  It does not do this in ortho mode.

koombo
Автор

thanks sir, but how about for, portrait version ?

watzdayy
Автор

Do you have the code base for the first type of parallaxing? I keep trying others that are out there and I can't get the camera to act properly.

TimCooley
Автор

Hi Mike. I need to know about "Mobile Input" on menu bar.How I can get it?

anattaanantachin
Автор

Always getting the error "Graphics device doesn't support Repeat wrap mode on NPOT textures. Falling back to Clamp." :(

christianb
Автор

i watched both of your videos, i just have to ask this, what if i have to make a collider on the background which i want to constantly move with the image, for example i want to make a collider on that grass and want it to move with the background so that my character can run on it or anything like that, i hope you understand what im trying to say

prathmeshnavik
Автор

How did you add the background image to the Quad?

socaiscool
Автор

Thanks for the update Mike. One question though: For an infinite runner you would keep the player standing still while the platforms/ground moved to keep the parallax working correctly? Instead of having the player move all the time while the platforms stand still.

Unain
Автор

someone mentioned a comment in your last video that aparently  fixed the poor performance on mobile devices by adding %1 to the end like so.

= new Vector2 ((Time.time * bgSpeed) % 1, 0f); 

will that still suffice or will it produce bad performance on mobile games? i have an infinite runner that i'm working on but it still seems to be fine, i haven't noticed any performance issues.

waterandtreefilms
Автор

when i start moving it skips some of the background (only when i start not if i keep pressing, everytime i let go and move again it skips some distance) why does it do that

Gluxable
Автор

Mike, i did that and it was perfect. But when i changed my project settings to android... everything was bugged! My quads are distorced and not tiling at all. I hope you can help me! Thanks!

dudu
Автор

Hey Mike, thanks for this great update. I'm using this code for an infinite runner but my background texture scrolls from right to left. How can I change this code so it scrolls from up to down?
thx for your help!

niconn
Автор

Hi Mike, fantastic tutorial.
Can you share this project on some repository?
Thanks

p.varano
Автор

Say, Mike, I would really appreciate a sort of top down sort of movement tutorial. Sort of like the movement in old final fantasy games, the grid based movement, not as free as old zelda games. The movement style I really have in mind is like from the Pokemon games (Ruby, Sapphire) where if you pressed the move button it animated one step and stopped, and you were locked to a grid. I hope you get to see this! Thanks. :) 

NotBerd
Автор

Thanks Mike, your tutorials are very useful and easy to follow. I was wondering if you could recommend us more courses & tutorials for 2D plataformers in adition to the live training modules offered in unity3d.com.

I'll be looking forward to your next tutorial! Best wishes

andresjfiorito
Автор

For some reason my quad isn't lighted properly like in the video. Anyone know why? :\

thunderdraco
Автор

Great vid! I really would like to know how you make your character move up and down in a 2D game, so it basically a 2.5D game? Some 2D games have that implemented so its nots limited to just Walking LEFT and Right and jump! :D

hoornii