Forum rules - please read before posting.

Can't make a scrolling camera

I followed this tutorial: https://adventurecreator.org/tutorials/working-2d-cameras

And put things like this into the Main Camara gameobject:

https://imgur.com/a/Klh3Vv4

My game tab says "Display 1 - No cameras rendering" when I press play. It doesn't matter if the "Camera" checkbox is ticked or it's not. Apart from that, I have to say that my default Main Camera gameobject didn't have a "Game Camera 2D" script, it has a "Main Camera" script that I deleted and put a "2D Game Camera" so I could do what the tutorial says. Also tried having both scripts but doesn't work. Any idea?

Comments

  • edited September 2022

    The MainCamera and your GameCamera2D components need to be on separate objects. The tutorial mentions using the Scene Manager to create GameCameras, which is the recommended approach over attaching components manually.

    The MainCamera object, which has the MainCamera component, will render the scene. Any GameCameras you create (of which you can have many) are used by the MainCamera as reference for its position - they themselves won't do any rendering.

    Best thing is to start over - delete the MainCamera object and use the "Organise scene objects" button at the top of the Scene Manager. This will re-generate the AC MainCamera. You can then create any 2D GameCameras you need from the bottom of the Scene Manager - under the "Cameras" section of the prefabs panel.

    To have a GameCamera become your scene's default, assign it in the "Default Camera" field further up.

    The process of working ith 2D cameras is covered in video form at this part of the 2D Primer tutorial.

  • Thanks a lot, Chris! Solved.

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.