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 juliancruz87 · Jun 09, 2011 at 07:29 PM · cameracharacter

How can I change the camera?

Hi I have a set space, and need to know how I can change the camera by pressing the number 1 and number 2 in C #, I need to Trasnporte by the cameras, and look in different places, thanks. anything else I can put two cameras to the same character?? and to make that change too, say that the front of the camera and the character behind the character. Thanks again.

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by CHPedersen · Jun 09, 2011 at 07:40 PM

There were some things in there I had a hard time understanding, but changing cameras is pretty simple, you do so by setting Camera.enabled = true on the camera you want to start rendering from, and Camera.enabled = false on all other cameras in your scene. This can be done in few lines of code using the static variable Camera.allCameras which returns an array of all enabled cameras. Disable everything in that array, then reenable the one camera you want to change to.

The last bit you wrote was harder for me to understand, did you mean a kind of rear view camera, sort of like what you do to render content into a rear view mirror in a car racing game?

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 juliancruz87 · Jun 09, 2011 at 08:03 PM

Yeah!!!, is for a racing game !!! How can I do it ??

Comment
Add comment · Show 2 · 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 CHPedersen · Jun 09, 2011 at 08:20 PM 0
Share

Unity Answers likes to keep posts on a question-answer basis, so folks tend to frown on the posting of additional questions as answers to your original question. :P Try to use comments ins$$anonymous$$d, like this one.

To answer your question, the easiest way is to place a camera at the vehicle's position and point it backwards, then have it render its contents into a RenderTexture. Then you apply that texture to a model of your rear view mirror. This method requires Unity Pro, however.

There is also a more advanced method that involves rendering a silhouette of the rear view mirror into the graphic card's stencil buffer. This results in an image in the stencil buffer that is totally black except for a mirror-shaped "hole" in it, which is totally white. You then render the backwards camera through the stencil, so that it can't render anything except where the stencil has white pixels. This causes it to render its contents into the exact area of the screen where the mirror is located. Think of that as painting on top of a piece of cardboard with a mirror-shaped hole in it. When you remove the cardboard, you have a mirror-shaped area of paint.

avatar image alee26 · Aug 06, 2012 at 10:25 PM 0
Share

I'm sure you have the all necessary skills to make up this!!!

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Aiming, Camera Orbit 0 Answers

Camera Follow Positive Y only - C# 1 Answer

How do I rotate a bone with a camera object? 0 Answers

How to make the camera follow the character like in e.g. tomb Raider ? 1 Answer

Camera not facing back of character 0 Answers


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