Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by coolkid115 · Aug 26, 2011 at 11:45 PM · camerachangezone

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 :)

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
2

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.

Comment
Add comment · Show 6 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image coolkid115 · Aug 27, 2011 at 12:23 AM 0
Share

Im new to Java, do you have a full script I could use for future reference. I'm a slow learner ::P

avatar image Waz · Aug 27, 2011 at 01:41 AM 0
Share

How about you make an attempt and then we help you learn what you are doing?

avatar image coolkid115 · Aug 27, 2011 at 03:47 AM 0
Share

I tried, Its like when the player enters a certain area the camera will change. I cant get it to work :( sorry.

avatar image UdevMike · Aug 27, 2011 at 11:16 AM 1
Share

What did you try that didn't work?

avatar image coolkid115 · Aug 27, 2011 at 07:09 PM 0
Share

I tried using the onTrigger Enter script. But I dont know how to write it.

Show more comments
avatar image
0
Wiki

Answer by exorakhilas · May 11, 2014 at 03:01 PM

I was wondering how to do this too. Here is my idea on how.

  1. 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.

  2. Place the camera in the area. It can be anywhere depending your type of camera (FPS or 3rd-person)

  3. 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

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by WewserLethalDude · Apr 23, 2016 at 10:52 AM

@Waz it should be GameObject , with 2 capital letters

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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

Changing Target Depending On Car Selected 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges