Hello Guest

Author Topic: Switching between multiple cameras  (Read 3095 times)

martin.labanic

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 1
    • View Profile
Switching between multiple cameras
« on: July 25, 2014, 04:49:05 pm »
Hey there, I'm having some problems switching between several tk2dcameras I have created in the same scene.
I have three instances: two for some menus, and one for gameplay. Using the following code that many people have used for regular cameras does not appear to work
Code: [Select]
tk2dcameraOne.enabled = false;
tk2dcameraTwo.enabled = true;

Same goes for this code:
Code: [Select]
tk2dcameraOne.camera.enabled = false;
tk2dcameraTwo.camera.enabled = true;
tk2dcameraOne.CameraSettings doesn't appear to have anything for this either.

I would appreciate any help provided, I'm using unity ver: 4.5.2f1, and the latest version of the 2d toolkit.

Update:
Fixed my problem. Turns out that I had my script that manages my GUI unchecked in the game object in the scene, thats three hours wasted on my part. For those interested, the code that worked was the following:
Code: [Select]
// Switch from cameraOne to cameraTwo
tk2dcameraOne.camera.enabled = false;
tk2dcameraTwo.camera.enabled = true;
« Last Edit: July 25, 2014, 05:29:49 pm by martin.labanic »