Hello Guest

Author Topic: Multiple cameras  (Read 6406 times)

sharky

  • Newbie
  • *
  • Posts: 4
    • View Profile
Multiple cameras
« on: November 26, 2014, 03:17:04 pm »
Hello people and first of all i wanna say thanks for 2dtoolkit and its cameras.
I wanted to ask if there are some general tips and rules about using several cameras in scene (except those at camera page in official unity documentation), or maybe particular about tk2dcameras?
My project crashes during loading scene in release build and it seems to be related to cameras, because when i deactivate additional camera on previous scene everything goes pretty well (and again, when i activate camera, game crashes). I assume i miss something important.

Trigve

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Multiple cameras
« Reply #1 on: November 26, 2014, 03:26:43 pm »
I'm using 3 cameras, 2 of them are tk2DCamera and didn't have any problems with it. The 2. tk2DCamera inherits the config from the 1. one. Does the application crash or you've got some exceptions? What's in the .log?

sharky

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Multiple cameras
« Reply #2 on: November 26, 2014, 03:45:16 pm »
Application crashes only in release build on device (it works perfectly when i try development build), so the only thing i could get is sigsegv error from logcat referred to some unity internal code.  I can simply reproduce this error with enabling and disabling tk2dcamera.
I assume the core problem is probably in my scene, which crashes on loading, and i will try to remake it somehow. But also wanted to ask about some good manners in using multiple cameras? Like i set culling masks layers and depth to each of them, so none will draw not "their" sprite. But this is all i've done.

Trigve

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Multiple cameras
« Reply #3 on: November 26, 2014, 04:34:22 pm »
And when you try the release for the PC?

sharky

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Multiple cameras
« Reply #4 on: November 27, 2014, 03:45:33 pm »
Quote
And when you try the release for the PC?
Works fine

After some tests i found that it crashes when i use 2 cameras on previous scene and also unity2d sprite on the next scene, which going to be loaded. Apparently it is problem of unity2d in 4.3 and i need to update. So it works right now without crashes with as much camera as i want to create.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Multiple cameras
« Reply #5 on: November 28, 2014, 12:36:24 pm »
Multiple cameras are fine, this sounds like a Unity bug :(
We use multiple cameras with and without tk2d all the time and never had any issues, but its probably a combination of things. Try latest Unity and see how that goes for you....

sharky

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Multiple cameras
« Reply #6 on: December 03, 2014, 11:06:14 am »
Yeah, that was a bug with Unity2d, thank you! :)
« Last Edit: December 03, 2014, 11:20:33 am by sharky »