• 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 florentine3d · Oct 19, 2015 at 11:36 PM · scripting beginner

Rotate cameras separately

I'am using this code (if (GetComponent().pixelRect.Contains(Input.mousePosition))) for determine what camera under mouse cursor. When i rotate MainCamera all fine, but when i rotate Second camera first camera rotate too, because pixelRect MainCamera include pixelRect Second camera.

How determine what camera under mouse cursor is and rotate particular camera?

Comment
Add comment · Show 1
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 Eno-Khaon · Oct 19, 2015 at 11:46 PM 0
Share

Just a tip for your post: If you don't use the code block formatting for your code, parts of it may be eaten by html code formatting rules.

For example, your "GetComponent" line is not displayed accurately for that reason.

To give an example:

Inside a code block,

 <sup>&lt;These&gt;</sup> **words** <sub>are</sub> ***unaltered.***

On the other hand, outside a code block,

<These> words are heavily altered.

Your question will be much clearer with appropriate formatting.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Eno-Khaon · Oct 19, 2015 at 11:52 PM

Logically, all cameras are watching the scene at all times unless instructed not to (disabled) and all cameras are receiving mouse input independently unless instructed not to.

The easiest way to solve this would be to make certain that you're only rotating a specific, selected camera (or only utilizing the mouse position input from a specific camera), but there's not an especially easy way to offer advice on what you can change without knowing what you're already doing in your code.

An example of the code you're using to handle the rotation (along with other important, related lines if applicable) would make it much easier to provide a clearer, more descriptive answer.

Comment
Add comment · Show 1 · 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 florentine3d · Oct 20, 2015 at 12:31 PM 0
Share

I'am realise this functionality. Thank you for your Reply!

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

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Making a button appear on a specific state? 1 Answer

Can't seem to get dash cooldown working... 1 Answer

How to stop all StopAllCoroutines(); from another script 1 Answer

Is there a way to change the desktop icon from the game itself? 1 Answer

NullReferenceException Error on first frame, despite everything functioning correctly 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