- Home /
2 different cameras
Hello I am trying to make a game for my friends and I to mess around with an iPhone and a computer is it possible to have 2 cameras and one camera view set specifically for the iPhone like the unity remote view and one for the computer.
I have made up a little code that's supposed to detect the different platforms #pragma strict var cam : Transform; function Update(){ if (Application.platform == RuntimePlatform.OSXEditor){ gameObject.SetActive(true); }else if(Application.platform == RuntimePlatform.IPhonePlayer){ gameObject.SetActive(false); } }
for iphone
#pragma strict var cam : Transform; function Update(){ if (Application.platform == RuntimePlatform.IPhonePlayer){ gameObject.SetActive(true); }else if(Application.platform == RuntimePlatform.OSXEditor){ gameObject.SetActive(true); } }
the iPhone doesn't have a separate when it's supposed to and the camera which i've set inactive is supposed be active but stays inactive.
Answer by tanoshimi · Jan 11, 2014 at 06:45 PM
Sure - you can enable/disable specific cameras based on whether Application.platform returns IPhonePlayer or WindowsPlayer.
Thanks you :) I'm not familiar with most of unity's syntax so thanks for helping.
Answer by DaveA · Jan 12, 2014 at 12:04 AM
If Update gets called it is because the object is active. You may want to do the opposite and set it inactive if not the target platform.
Your answer
Follow this Question
Related Questions
Camera Zoom for Orthographic (iPhone Touch) 1 Answer
How to detect Game Object is touched in Unity iPhone? 1 Answer
Where to start? 3 Answers
Unity3D 3.X generates a iPhone_target2AppDelegate? Use? 0 Answers
Unity iPhone 2D Left Right movement 0 Answers