Closed vgreen7 closed 5 years ago
I added an example with two scenes and two cameras:
https://github.com/britzl/defold-orthographic/tree/master/example/multicamera
Each scene is a collection loaded via a proxy. Each scene contains a camera game object following a player game object. This example works without any problems.
Can you please create a minimal example reproducing the problem you have?
Thank you so much for for your time and help. Here is my repo with the issue in it: https://github.com/vgreen7/camera-test
Thanks so much again for you help
The project didn't compile (broken atlases and a typo in one of the script files). I was able to reproduce your problem when I fixed those issues. The reason your project fails is the following:
You unload level1 and load level2 at the same time. When level2 is loaded the camera in level 2 registers with Orthographic. When level1 is unloaded the camera in level 1 is unregistered from Orthographic.
The problem in your case is that both cameras have the same id and level1 finishes unloading after level2 has loaded which causes the camera to get unregistered.
Either give each camera a unique id or make sure that level1 gets completely unloaded before loading level2.
Wow, I can't believe the answer was so simple, thanks so much!!
When working with Orthographic I have realized that when switching between collections that both have Orthographic in them returns an error:
_
_