2D Parallax Scrolling Backgrounds in Unreal Engine 5 - Paper 2D Tutorial

Sdílet
Vložit
  • čas přidán 17. 06. 2024
  • Get my 12 hour course on how to make 2D games with Unreal Engine:
    tinyurl.com/Ultimate2D
    Download the free starter project to code along:
    / starter-project-105973970
    Get the finished Project files as a Patreon supporter:
    / finished-project-10597...
    Learn how to create infinite parallax scrolling backgrounds in Unreal Engine 5 through Paper 2D.
    🔔Subscribe: / @cobracode
    Twitter: / cobracodedev
    Discord: / discord
    Timecodes:
    0:00 Intro
    1:02 Setting up Background Sprites
    4:17 Setting up the Custom Material
    10:35 Updating with Camera Position
    16:21 Improving the Material
    Icons made by Freepik (www.freepik.com) from Flaticon (www.flaticon.com/)
    🎵 Music By:
    - Squeeda - Transform
    - Provided by Lofi Records
    - Watch: • squeeda - Transform 🦌 ...
    #cobracode #gamedev #unrealengine #ue5

Komentáře • 62

  • @CobraCode
    @CobraCode  Před 5 dny +4

    Get my 12 hour course on how to make 2D games with Unreal Engine:
    tinyurl.com/Ultimate2D
    Download the free starter project to code along:
    www.patreon.com/posts/starter-project-105973970

    • @Alohamora_13
      @Alohamora_13 Před 5 dny +2

      Definitely recommended!! One of the best courses that I have studied for UE and 2D games!

    • @Enkeria
      @Enkeria Před 3 dny +1

      Bought it. Not sure how to actually get it, I just get a loop on their site and when I click on what I have bought, it takes me to the page where to buy it. Uhm. Edit: Fixed it. I had to buy it again. Some how it got refunded same second I bought it some how. But now its there, I had to buy it full price, which is fine. Its worth it. Thanks.

    • @CobraCode
      @CobraCode  Před dnem

      ​@@Enkeria Thanks for the support! Glad you figured it out!

    • @Enkeria
      @Enkeria Před dnem +1

      @@CobraCode thanks. And I finished first course, with minor issues I replayed and fixed. Blueprints is still waaaay complicated for me. But I added sound for the quick draw before I finished on right place I think, and have ideas to experiment to just draw new assets for it and make it complete. I have had some ideas of micro games like wario ware etc before. So keeping the ideas there. The crash course was fun, I really want to learn more, and I get the learning curve is steep, but if I can make a full game, I will contact you and let you know about it. Hope for good epic games news too soon, about 2D. Thanks for the course.

  • @PoisonClanTechniques
    @PoisonClanTechniques Před 5 dny +8

    Thank you for creating this. I have been trying to create a 2D parallax for my scroller for weeks 😂 This is exactly what I wanted to achieve!

    • @CobraCode
      @CobraCode  Před 5 dny +1

      Awesome :D Good timing!

    • @PoisonClanTechniques
      @PoisonClanTechniques Před 5 dny

      Could you at some point show the process to take a 2D character illustration and create a sprite sheet that can be imported to Unreal Engine? I have been tinkering with this, but your tutorials for Unreal are sooo good! 😆

    • @CobraCode
      @CobraCode  Před 5 dny +1

      @@PoisonClanTechniques
      Thank you :)
      I think this is pretty close to what you're looking for.
      czcams.com/video/UiMUTf2kCSs/video.html

    • @PoisonClanTechniques
      @PoisonClanTechniques Před 5 dny +1

      Wow…amazing! Thank you for this, I’m glad I subscribed 🎉

  • @1200Nickman
    @1200Nickman Před 5 dny +5

    I was thinking on how to solve this just like 2 weeks ago :D Excellent tutorial as always.

  • @madnessjones9996
    @madnessjones9996 Před 3 dny +1

    I am so glad I found your channel! You make Unreal Engine feel less mysterious for those of us who want to work with 2D instead of 3D. Even a newbie like me can understand your tutorials. I have a suggestion for a video, since I can’t really find it anywhere else. I know you’re busy and probably have a lot of video ideas already, but if the idea interests you it would mean a lot to me. I can’t figure out how to create a 2D procedurally generated map that leads to randomized levels (like FTL). In Godot the answer was the noise filter, but I don’t know if Unreal has something like that or not. Anyway, thank you for your videos and hope you have a great week :)

    • @CobraCode
      @CobraCode  Před dnem

      Thank you and also thanks for the suggestion.
      But yeah that's a very niche topic I probably won't be able to cover :(

  • @user-iy9gq4tj4k
    @user-iy9gq4tj4k Před 2 dny +1

    Thank you for finally creating this this is a blessing

  • @thehammerofwrath
    @thehammerofwrath Před 5 dny +3

    Consistently impressed by the quality of content you are producing. Clear. Concise. Helpful. THANK YOU!

  • @brandonjacksoon
    @brandonjacksoon Před 6 dny

    Looks beautiful, thank you. I really apritiate that for your tutorials you are using the best looking assets.

  • @SmurmBreep
    @SmurmBreep Před 5 dny +1

    Thanks for this, I remember asking a while ago, love to see it ^^. It makes me want to take a break from my 3d projects to do something 2D! Awesome video, keep up the good work.

  • @brandonjacksoon
    @brandonjacksoon Před 6 dny +1

    Thanks man, you are the best!

  • @TheTrueFriend.
    @TheTrueFriend. Před 5 dny +1

    thank you so much , as always you are amazing.

  • @kamilantosiewicz4977
    @kamilantosiewicz4977 Před 5 dny +1

    Great video!

  • @suizenjiful
    @suizenjiful Před 5 dny +2

    すばらしい。Udemyの講座も凄いわかりやすく役に立ってます。

    • @CobraCode
      @CobraCode  Před 5 dny +1

      ありがとうございます :)

  • @brandonjacksoon
    @brandonjacksoon Před 6 dny +1

    16-bit era! Nostalgia.

  • @ZimMabu_GameDev.
    @ZimMabu_GameDev. Před 5 dny +1

    nice thx

  • @LifeRhymeVevo
    @LifeRhymeVevo Před 5 dny +1

    So i recently started your first course, I am unsure if this is included in your course but you should make a whole playlist on youtube for these tutorials that aren't in the course. That way newbies like me know what else to learn or have easier access to learn the extra stuff through the playlist.

    • @CobraCode
      @CobraCode  Před 5 dny

      Thanks, that's a good suggestion.
      Could put it as a note after the last video.

  • @PonyProductionsVII
    @PonyProductionsVII Před 5 dny +1

    Awesome tutorial like all your videdos and courses. How do you think is the best way to expand this to different rooms that have different sprites?

    • @CobraCode
      @CobraCode  Před 5 dny +1

      Thank you :D
      If you want to extensively use this I'd probably try to make it a bit more generic and instead of doing things directly inside of the character create a separate child actor with the camera and background layers.
      Would then probably set up some logic in there so I only have to select which sprites to use and automatically spawn the sprite components on BeginPlay.
      Then you could package that up as a plugin and reuse it throughout all of your projects!

  • @npoctobblpogok3730
    @npoctobblpogok3730 Před 5 dny

    никогда бы не подумал что для достижения эффекта параллакса нужно так сильно заморачиваться

  • @Alohamora_13
    @Alohamora_13 Před 5 dny +3

    Thanks a lot Stephen for your brilliant videos and tuts! I'm learning so much from your videos! Would there be a way to package this Parallax scrolling setup for re-use in multyiple projects similar to Godot where we just have a ParallaxBG and Parallax layer nodes available?

    • @CobraCode
      @CobraCode  Před 5 dny +1

      Thanks!
      Yeah you could certainly make this a bit more generic and package it up as a plugin you can reuse throughout all of your projects.
      This video covers how to make BP Plugins.
      czcams.com/video/6IJhL7qfFYk/video.html

    • @Alohamora_13
      @Alohamora_13 Před 5 dny

      @@CobraCode Amazing!!! thanks a lot!

  • @lbxen
    @lbxen Před 11 hodinami

    Hey man, could you do a 2D Checkpoint tutorial? Like so when the character steps on a flag it spawns them there when they die, and so if they overlap a different checkpoint it saves their spot there, and if they were to return to previous checkpoints it'd spawn them at the previous checkpoint location if they die

  • @OniBojan
    @OniBojan Před 5 dny

    Hey Cobra, I did achieve same effect with having parallax scrolling background as separate component, and adding it to the level. All my player did, is update it's position in the game mode, and then game mode would notify listeners of the player position change. Then scrolling background actors would move themself. To be honest, I do not like the direct responsibility of a player towards the background. Player should not be aware of the backgrounds, and change their positions direclty. Also, what will happen when you switch to another level, and background is different? Then you must add a lot's of logic inside of player... the logic it should not care about.

  • @medieval.software
    @medieval.software Před 5 dny +1

    Instead of dividing by a static number like 20k in this case, could you divide by the -Y position multiplied by some constant? That way you could adjust the parallax speed in the viewport by moving the sprite farther away.

    • @CobraCode
      @CobraCode  Před 5 dny

      Yeah something like that should also work.
      Actually Brackeys did something similar to that in his Unity Parallax video.

  • @291jhsjasd2
    @291jhsjasd2 Před 4 dny

    any plans on making tutorials for 3d Pixelart Environments/Levels for 2.5D games, like those seen in Octopath Traveler, SacriFire, etc? There's barely any tutorials for it so It would be really helpful.

    • @CobraCode
      @CobraCode  Před 4 dny

      It's too niche to cover in a separate video and asset creation isn't really the focus on this channel.
      But I do have plans to remaster the HD-2D look video and might touch upon that a bit!

  • @cindyn4403
    @cindyn4403 Před 5 dny +1

    Hello! Thanks for all your videos - I also bought your course which is really awesome :)
    I wanted to ask you though if there is a possibility shift the camera higher? I tried everything already which is why I am highly confused. Or do I have to make a seperate Blueprint if I want to do it more customised?
    I will definitely try this out for my current 2D Project :)

    • @CobraCode
      @CobraCode  Před 5 dny +1

      Thank you :)
      You'll have to adjust the position of the background layers slightly if you don't want them to look weird with a higher camera.
      You could also take things a step further and introduce parallax scrolling on the Z axis as well.
      This is a nice blog post explaining it
      www.nexatli.com/blog/parallax-backgrounds-for-paper2d

    • @cindyn4403
      @cindyn4403 Před 2 dny

      @@CobraCode Hello! Thanks for the fast answer :) I also wanted to ask about the Character camera. Like We use the orthohgraphic camera, but I cannot position the camera of the Character higher? Like the only way I can change how far away the camera is, is with the Orthowidth. But I don't want to Zoom in more, I just want to put the camera a little bit more up. Is there an option for that or do I have to make a custom Blueprint for this?

    • @CobraCode
      @CobraCode  Před dnem +1

      @@cindyn4403 Hey, you probably don't want to move the camera directly, but the spring arm it's attached to.
      You can literally just move it upwards slightly and that should work.
      There's also a setting called 'offset' though I believe you could also use

    • @cindyn4403
      @cindyn4403 Před 13 hodinami

      @@CobraCode Hello! I tried all of those things and it didn't move. I also tried to change from absolute Location to relative and nothing worked so far. I am really confused why it doesn't work :( I did all my settings like you did in your videos but I really don't understand why the camera would not move a little bit upwards.

    • @CobraCode
      @CobraCode  Před 2 hodinami

      @@cindyn4403 Hey that is definitely strange.
      I would probably start out in a fresh project for a sanity check and make sure no other systems are interfering with the camera in some way.
      If you can't even get it to work there, then there is something seriously wrong.

  • @MoksockProductions
    @MoksockProductions Před 5 dny

    Love the video and its super helpful for this but does this work if i pinned it to a tilemap or anything like that? because i would love to be able to have this but have the background change based off the 2D tilemap im on

    • @CobraCode
      @CobraCode  Před 5 dny

      Yeah that should work.
      You'd still have the same setup and just put your tile map in front of it.
      You'd have to set up a system though where you can change the background sprite depending on which stage you're in.

  • @compatriot852
    @compatriot852 Před 5 dny

    While on the subject of backgrounds, is there any possibility you'd cover 2.5D/2D-3D hybrid environments with sprites in the future? I remember you doing a top down video a while back, but only used a 3d stylized environment.
    I know octopath traveler does this well by using a lot of animated and static 2d sprites and 3d models for the background

    • @CobraCode
      @CobraCode  Před 5 dny

      Hey, I think that might be too specific and niche for a CZcams video.
      Sounds like a good addition to a course though.

    • @compatriot852
      @compatriot852 Před 5 dny +1

      ​​@@CobraCodeTotally understand. It's a technique I've seen mainly used for Jrpgs, so it'd probably be better fitting for a course touching on that subject.
      So far I've found a channel called UE5 2Don that's touched on the subject matter in a video. Channel is in Japanese, but they provide English subtitles.

    • @CobraCode
      @CobraCode  Před 5 dny +1

      @@compatriot852 Oh yeah!
      He's got a lot of great stuff!

  • @ShyGuy47
    @ShyGuy47 Před 5 dny +2

    Is there a way to get the parallax effect on the Z axis as well? If your camera is following your character through an up or down movement, like jumping or falling, the background stands still. This creates a dizzying sensation because you expect the Z axis to behave the same way as the X axis.

    • @CobraCode
      @CobraCode  Před 5 dny +1

      Yeah, you certainly can.
      I decided against including it in the video because it already dragged on too long.
      The part in the material where we use the 'Append' node and pass it a 0 is where you'd want to put your logic for scrolling the Z axis.
      Most of it will work the same, however one problem you have is that you can't do an infinite scroll like left to right since things don't connect and you'll have to mask out the bottom of the hills since it will otherwise come in at the top of the screen.
      This blog post has some interesting stuff about it
      www.nexatli.com/blog/parallax-backgrounds-for-paper2d

    • @ShyGuy47
      @ShyGuy47 Před 5 dny +1

      @@CobraCode My man! Worked perfectly. Copied all the code before the append in M_ParallaxSprite and attached to the Append B input. Made sure Mask (B) was selected and multiplied the ParallaxMultiplier float by -1 and it all worked out. Thanks for your time and knowledge.

  • @carlosrivadulla8903
    @carlosrivadulla8903 Před 5 dny

    is the paper sprite an exclusive component os the plugin and only for papperz projects?

    • @CobraCode
      @CobraCode  Před 5 dny +1

      The PaperSprite is a part of the official Paper 2D plugin which is active by default.
      PaperZD wasn't used in this video, but it also relies on the building blocks of Paper 2D and would use PaperSprite and PaperFlipbook.

  • @brandonjacksoon
    @brandonjacksoon Před 6 dny +1

    1st comment :)

  • @bexplosion
    @bexplosion Před 5 dny

    No build-in parallax scrolling is another sign that Epic has abandoned 2D.

    • @CobraCode
      @CobraCode  Před 5 dny +3

      Built-in parallax scrolling is not a common thing.
      Unity doesn't have it either.
      Godot just got it very recently.
      If you want to point fingers at something, point at the tile map editor that still says 'Beta Preview'