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
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.
Another 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:
I think it might a nice feature and I would totally love to see it.
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.