• 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 WatchDogeRun · Nov 16, 2014 at 02:57 AM · camera-looklook

Switch Camera When Game Object Clicked, and Exit with X Button

Ive Looked for this everywhere. I have made a door with a peep hole in it. I need to make it to where when you click on the peep hoe, you will be switched to a camera inside the room, and you can go back to main camera by pressing x. I have looked continuously for this, and no luck. Please shed some light on my situation! Thanks!

Comment
Add comment · Show 2
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 Landern · Nov 16, 2014 at 03:00 AM 0
Share

Get references to camera objects.

Ensure a Collider is around peephole.

In the OnClick...

$$anonymous$$odify cameraObject.camera.active to false for all that, perhaps thats just the main camera, who knows.

$$anonymous$$eep reference to other camera to switch back to.

$$anonymous$$odify the camera you want to be active to have active set to true.

avatar image WatchDogeRun · Nov 16, 2014 at 03:07 AM 0
Share

So do I try to make a script?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Tony_T · Nov 16, 2014 at 12:13 PM

I would recommend checking the Camera Script References if you are a beginner.

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Rotating a camera based on TouchPad input. 3 Answers

first and thirt person view 1 Answer

Player Torso Rotation to mouselook. (Diagram included) 0 Answers

Changing First person look 0 Answers

Gameobject Smooth Rotate 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges