Parallax Effect in Unity Tutorial - Infinite Scrolling Background

Uploaded by samyam
Share: Twitter Facebook
UNITY SPRING SALE! ? https://assetstore.unity.com/?aid=1101ljAbS ?
Check out my other video where I go over some of the awesome assets on sale! https://youtu.be/mso25zPqdWs
Use code WELCOME2022 for an extra 25% off for new buyers
⏱️ April 11 - 29 ⏱️

? Get the Source Code ?
https://www.patreon.com/posts/63585249

? Support Me ?
Patreon: https://www.patreon.com/samyg
Donate: https://ko-fi.com/samyam

►? Relevant Video Links ?
ᐅKenney Assets Background Elements
https://www.kenney.nl/assets/background-elements

►? Assets Shown In Video ?
ᐅMAIN SALE ?
https://assetstore.unity.com/?on_sale=true&rows=96&aid=1101ljAbS
ᐅCorgi Engine - 2D + 2.5D Platformer
https://assetstore.unity.com/packages/templates/systems/corgi-engine-2d-2-5d-platformer-26617
ᐅUltimate Character Controller
https://assetstore.unity.com/packages/tools/game-toolkits/ultimate-character-controller-99962
ᐅQuibli: Anime Shaders and Tools
https://assetstore.unity.com/packages/vfx/quibli-anime-shaders-and-tools-203178
ᐅAmplify Animation Pack
https://assetstore.unity.com/packages/3d/animations/amplify-animation-pack-207911
ᐅAtmospheric House (Modular)
https://assetstore.unity.com/packages/3d/environments/urban/atmospheric-house-modular-192712
ᐅSpace Graphics Toolkit
https://assetstore.unity.com/packages/tools/level-design/space-graphics-toolkit-4160
ᐅ2D+3D Infinite Runner Engine
https://assetstore.unity.com/packages/templates/systems/2d-3d-infinite-runner-engine-51328

ᐅFLASH DEALS ⚡
https://assetstore.unity.com/?flashdeals=true&aid=1101ljAbS
ᐅGrabbit - Editor Physics Transforms
https://assetstore.unity.com/packages/tools/utilities/grabbit-editor-physics-transforms-182328
ᐅPaint in 3D
https://assetstore.unity.com/packages/tools/painting/paint-in-3d-26286
ᐅPolygon Arsenal
https://assetstore.unity.com/packages/vfx/particles/polygon-arsenal-109286
ᐅClayxels
https://assetstore.unity.com/packages/tools/game-toolkits/clayxels-165312
ᐅBoing Kit: Dynamic Bouncy Bones, Grass, Water, and More
https://assetstore.unity.com/packages/tools/particles-effects/boing-kit-dynamic-bouncy-bones-grass-water-and-more-135594
ᐅLiving Particles
https://assetstore.unity.com/packages/vfx/particles/spells/living-particles-105817
ᐅHEROIC FANTASY CREATURES FULL PACK Volume 1
https://assetstore.unity.com/packages/3d/characters/creatures/heroic-fantasy-creatures-full-pack-volume-1-5730

In this video I'll show you how to create a Parallax 2D effect to mimic depth perspective in a 2d scene (orthographic camera). First we have to add in an image and make it the size of the screen, duplicate it 2 times, and put it to the side of the original image, so that the sprite can be around 3 times the screen size of the camera. These two extra sprites are made children of the main center sprite. This is for the looping. Then we write a script that moves the sprite in relation to the camera at a different speed. We loop the parallax effect by shifting the position of the sprite forwards if the camera starts to cut off the sprite render. We add in different layers to demonstrate the different environment movements, background, middleground, foreground, and repeat the process.

►⏱️ Timestamps ⏱️
0:00 Intro
0:43 Sponsorship
2:02 Sprite Layer Set up
7:11 Parallax Effect Script
11:32 Loop Parallax Effect
16:49 Add in Other Layers
19:41 Y Parallax Effect
22:19 Camera Move Script
22:41 Outro

??THANK YOU TO ALL MY PATRONS ??

❯❯❯ My Links ❮❮❮
? Patreon ?
https://www.patreon.com/samyg
? Discord Server ?
https://discord.gg/SwCKB3Q
? Twitter ?
https://twitter.com/samyam_youtube
? Facebook ?
https://www.facebook.com/samyam.youtube/
? Like and Subscribe! ?

?️ Computer Setup ?️
*As an Amazon Associate I earn from qualifying purchases.
https://www.amazon.com/shop/samyam

Disclosure: This post may contain affiliate links, which means we may receive a commission if you click a link and purchase something that we have recommended. While clicking these links won't cost you any money, they will help me fund my development projects while recommending great assets!

#madewithunity #gamedev #unity