Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - martin.labanic

Pages: [1]
1
Support / 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;

Pages: [1]