x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How do I set up a parallax (panning) background in a 2d side-scroller?

I am trying to set up a parallax background image for my 2d side-scrolling game so that as I move horizontally through my level the picture in the background stays in the same position.

I saw some similar postings on this site but nothing I understood. I'm new to creating games so any pictures or step-by-step guides would be greatly appreciated! I'm really lost here!

Thanks a ton.

Product Version: UE 4.8
Tags:
more ▼

asked Jul 31 '15 at 10:35 PM in Blueprint Scripting

avatar image

kirby.c
5 3 5 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Hi,

this is doc page describing 2D content https://docs.unrealengine.com/latest/INT/Resources/ContentExamples/Paper2D/index.html , you can simply download free example called "content example" from launcher and open level probably called "Paper 2D Content Examples"to see how 2D things work

regarding to one way of implementation:

simply use 2D texture behind your level and move it in opposite direction with small speed, so when character moves, visually it would look like background moving too

if you create new project in editor and select 2d sidescroller, on level you can right click background and select "find in content browser"

also you can try make animated sprite https://www.youtube.com/watch?v=9FKG7fFWKOA&index=2&list=PLc9juHldTxu1Yxnyw7U7SaSUdZfC6shED and probably control it's update to move image in directions

p.s. don't forget mark question as answered with little gray circle button under any answer (not comment, but whole answer) when problem solved, so anyone else later can have same question and may find solution faster, if you find solution on your own, don't forget write it too

more ▼

answered Aug 01 '15 at 02:27 AM

avatar image

happyhorror
576 54 46 72

avatar image kirby.c Aug 01 '15 at 10:13 PM

Hi happyhorror, thanks for the response! However, would you have any idea what the blueprint to do this would look like?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Hi Kirby,

If I'm understanding the question right, all you need to do is change the camera setting from orthographic to perspective.

In C++ it should be as easy to commenting out the orthographic lines, as it's perspective by default.

In blueprint, just select the camera in the viewport, and look through it's properties, wherever it's set to orthographic, set it to perspective.

more ▼

answered Feb 17 '16 at 06:10 AM

avatar image

Hennez
202 16 15 27

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question