Forum rules - please read before posting.

2.5D Camera Scrolling along wide background image.

I'm working on a 2.5D game and I want to do a scrolling background, tipical case of a camera pan or following the player along a wide area. I understand how to do this in 2D, and in 3D, but in 2.5D how do you do it? is there another component for something like this? 
The player walks through a long corridor and the camera will have to follow him and the background moves, so the current setting for the tutorial about 2.5d camera settings will not work and I couldn't find any other information related. 

I think I know how to do this from Unity as an alternate method, animating the camera and not using the background component but a textured plane. But I think it's kind of a hack I was wondering if the engine has a tool for this situation that works better.  Thanks!

Comments

  • I have replied to this in your other thread - please don't double post in future, I answer all questions when I can.
  • Sorry I duplicated it because I thought it was better to have that as a separate thread if anyone else comse looking. Here I paste your comment so we can all benefit from it. Thanks It was what I thought, good tip to use the ortographic projection for this. 
    ----------

    2.5D cameras are more of a convenience than anything, because they allow you to easily map a background to a camera.  However, the caveat is that the background is fixed, and cannot scroll.

    You can, however make use of regular 3D cameras as part of your 2.5D game when necessary.  It won't be listed in your Scene Manager, but you can drag it in from the Assets folder under Adventure Creator -> Prefabs -> Cameras -> GameCamera.  You can then create a camera that scrolls, but you will need to make the background a physical sprite in your scene - just be sure to set the camera's Projection to Orthographic.
  • edited September 2016
    I think it might not be the best possible solution. Considering this initial setup:
    image
    After scrolling perspective camera along with 2d sprite we get something like this:
    imageAnother solution here would be to render both cameras (background and foreground) to a texture and scroll an ortographic camera on it to get the following result:
    imageI think it might a nice feature and I would totally love to see it.
  • Good points.  For the record - 2D GameCameras will already scroll correctly if it's Projection field is set to Perspective.  What you'll achieve is a Ken Burns effect whereby the camera moves but the perspective remains locked.

    Again, the background camera is more for convenience, and I think scrolling "hidden" backgrounds could cause more trouble than they're worth - especially when having to account for things like aspect ratios and so on.

    I would recommend relying on an "in-scene" sprite for your background (limited to your camera with the "Limit To Camera" component), and using a 2D GameCamera.  It should work even if it's not perfectly aligned down the Z-axis, but if it needs tweaking you can always duplicate the GameCamera2D script and use a modified copy for your own needs.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.