Hello all.
It's my first time in trying to make a game and I 'm looking if I can do it in 2.5D, that is, photographic backgrounds. I'm trying to follow the manual and I can't even have a background visible.
Here are my steps:
Still a blue view in the game. GameCamera2.5D is at (0,0,0) and If I put it to (0,0,-10) it shows a player moving but no background.
Now If I turn off MainCamera and GameCamera2.5D and leave BackgroundCamera, the image is displayed. Why it needs a BackgroundCamera since it already has a GameCamer2.5D?
Layers seem OK.
Perhaps I'm a total newbie.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Welcome to the comunity, @mchourdakis.
GameCameras are used as position references only - it'll be the MainCamera that is enabled at runtime, with its position being set by the active GameCamera. Keep the MainCamera enabled, and the GameCamera disabled.
Bring the GameCamera back along the Z axis, or move the scene's Default PlayerStart (which is where the Player will begin from) so that it's positioned in front of it.
The BackgroundImageUI is used to render the background image, but it sounds like there's a layering issue if it only becomes visible after turning off the MainCamera.
What are your AC/Unity versions, and what Render Pipeline are you using? If you're using URP, then you'll need an add-on script to adjust the way this layering occurs. Such a script can be found on the AC wiki here:
https://adventure-creator.fandom.com/wiki/2.5D_games_with_URP
Latest, 60000.36f1 and v.1.82.5
I'm starting with an empty scene, no default stuff.
"With folders" button creates
I add the GameCamera25D disabled as you suggested, and a BackgroundImage with the AC buttons and I assign a texture to it.
When I add the 'Set as Active" button it creates a BackgroundImageUI and the main camera gets the transform of it, so I set again say to 0,0,-2.
So the MainCamera is at 0,0,-2, PlayerStart is at 0,0,-1 and BackgroundCamera is at 0,0,0.
MainCamera has a "Solid Color" environment of blue, which is what I'm seeing. I see the Player, so the player is correct.
MainCamera culling mask is everything except BG image. At this point the "background" which is at 0,0,0 isn't visible.
I followed the 2.5D video tutorial and at the point I insert the images to the camera it fails to display them (unlike in the video).
It would help if there was a 2.5D demo like the 2D and the 3D ones.
If I delete the created 'Background Camera' which is created when pressing "Set as Active" on the Camera2.5D it displays the image ... any clues?
It is also displayed when I mess with camera priorities..seems that the BackgroundCamera has low priority and it doesn't show.
My bad... wrong placement of the URP script
Thanks for your help.
No problem. Is the script solving the issue?
Partially. It works in Play mode (When I press Play) but it doesn't work in the preview "Game" tab.
I added it as a component to the MainCamera and/or GameEngine, but still.
Any ideas?
Try replacing the script line:
with:
Then restart the scene.
The script is essentially adding the Background Camera to the MainCamera's "Camera stack" as an Overlay camera. If it's not running in Edit mode, making this change manually should have it show up.
Good work, thanks
I still have rendering issues with the player etc, for now I will switch to the old, non URP pipeline.
The default tutorial files are set up with standard materials for non-URP.
If you use URP, a variant of these files, with URP materials, can be found here:
https://www.dropbox.com/s/mb80oxowhvfzar8/TutorialFiles_URP.unitypackage?dl=1
Thanks a lot for that, I will take a look.