Forum rules - please read before posting.

Default Camera Buggy?

edited December 2022 in Technical Q&A

Hi guys, I followed the tutorial "2D primer" all the way through and at the point where we are supposed to attach the default camera, suddenly the screen turns blue in the scenes preview image and in game view I dont see anything besides the UI Menu anymore. And even that is buggy.

I have experienced the same problem in my prior game.

Would someone mind explaining to me what I'm doing wrong?

It's really frustrating, since I just can't figure out how to solve the issue.
I can not even undo the issue because I already deleted my initial main cam after creating the new NavCam for the Default Camera view. Was that my mistake?

The new Main Cam that I input now has the same problem so I don't know what to do now...

See Image for inspector & scene settings

https://imgur.com/a/nIy2jx4

Thanks

Comments

  • Here you can see how the game is completely broken after adding the default camera:

    https://imgur.com/a/AiW2sT3

  • edited December 2022

    "SOLVED" or a bug?... It must be something wrong with the Game Camera 2D Script Component. Once I deleted that component from all my cameras I can finally see again. So I guess we have to leave the default camera field free?

  • edited December 2022

    Apologies for the frustration. From the screenshot, it looks like an issue with the camera's Z-position.

    Don't attach the GameCamera2D component manually to your MainCamera - the two should be on separate objects. The MainCamera object is the only one intended to render anything - GameCameras are just for reference - so the GameCamera component will disable its own Camera component at runtime. That's what's happening in your last screenshot.

    Your first screenshot is correct, in the usage sense - the two components are separate, and the MainCamera is attaching itself to the "NavCam 1" object. You can see this noted at the bottom of the MainCamera's Inspector at runtime.

    When the MainCamera is attached to a GameCamera (in this case, "NavCam 1"), it will adopt the position values of that camera. The Z-position is currently zero, which'll cause display issues if your scene sprites also have this position along the Z-axis.

    Make sure that the NavCam 1's Z-position is negative when in Edit mode, and it should appear correct when the MainCamera is attached to it at runtime.

  • Ahh thanks for your response, it worked!

    I have now divided both cameras and set their z-values to -10. Also I have made sure to delete the Game Camera 2D (script) component from the MainCamera. Now it seems to work fine even with the default camera set up as NavCam1.

    Thanks again.

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.