- Home /
Changing Camera
I'm making an overhead platformer that has 2 players at once. I have my Main camera over the two players at the start. I want to make it so that when they hit a certain zone it will switch cameras. Can someone please help me with this. Thanks :)
Answer by Waz · Aug 27, 2011 at 12:13 AM
To change cameras:
camera1.gameObject.active = false;
camera2.gameObject.active = true;
to detect entering a zone, OnTriggerEnter is one way.
Im new to Java, do you have a full script I could use for future reference. I'm a slow learner ::P
How about you make an attempt and then we help you learn what you are doing?
I tried, Its like when the player enters a certain area the camera will change. I cant get it to work :( sorry.
I tried using the onTrigger Enter script. But I dont know how to write it.
Answer by exorakhilas · May 11, 2014 at 03:01 PM
I was wondering how to do this too. Here is my idea on how.
Create a trigger box on the area you want the camera to trigger. You can have more than one box for one area or terrain.
Place the camera in the area. It can be anywhere depending your type of camera (FPS or 3rd-person)
Using the LookAt script, put a condition. When player triggers each area, it turns off all other cameras except the one where player is in.
But.. I have one issue. Is it possible for player to be in the position where it will trigger both areas? If yes, what will happen to the cameras? I am trying to do this as I type here :D
Answer by WewserLethalDude · Apr 23, 2016 at 10:52 AM
@Waz it should be GameObject , with 2 capital letters
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Camera Change Bug 0 Answers
Changing Cameras With One Button 4 Answers
How to change Target of camera from Standard Assets 1 Answer