Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
1
Question by jimbobuk · Dec 18, 2009 at 01:23 AM · cameraeditor

Best way to manage multiple camera angles?

A few times now i've had to have alternative camera angles that i move between. Both ways seemed non-optimal to me so i thought i'd ask what the "right" way of doing this is. Here are the two ways i've tried this.

  • Make multiple actual cameras in the scene and setup accordingly. Then at runtime enable and disable the cameras (and their sound listeners) as required.
    • Pros: Able to actually preview the cameras in the editor whilst positioning them
    • Cons: Fiddly runtime tasks and i get the impression this is not really what multiple cameras are for, rather for multiple simultaneous views
  • Make a single camera and multiple camera "proxies" (out of empty gameobjects) in the scene. At runtime just copy the relevant camera proxy details into the main camera for snaps or lerp as required for blends.
    • Pros: Intuitive, flexible and efficient at runtime
    • Cons: Horrible to setup in the editor, you basically have to run the game to get the camera proxy activated to be able to test its orientation, this really slows things down!

As you can see both options have their issues. I've not tried using a combination of the two, multiple cameras but only copying the details from the other cameras as required. May be an option, i'm just concerned at whether its a performance problem to have too many cameras, especially ones that will never actually be looked through directly.

As ever, thanks for your time

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
7
Best Answer

Answer by Peter Alexander · Dec 18, 2009 at 02:08 AM

Do both. Set everything up using new camera objects, but then in game just change your main camera to use their orientation.

There is no performance penalty for having multiple inactive cameras, unless it's some weird Unity idiosyncrasy.

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
2
Best Answer Wiki

Answer by xaddict · Dec 18, 2009 at 09:31 AM

You could also use the Unity Gizmos to actually draw the layout in the editor. you could:

  • Create an empty object (A)
  • Put an empty object (CAM) inside (A) with a camera gizmo (Gizmos.drawIcon)
  • Put another empty object (TARGET) inside (A) with a target gizmo (Gizmos.drawIcon)
  • Make (A) draw a line from (CAM) to (TARGET) with Gizmos.drawLine

this way every place you want to be able to change to has all variables set up. Also, it allows you to preview everything in your editor.

Of course this lacks a sense of how big the camera viewport would be compared to the surroundings, but you can also make use of Camera.DrawWireCube to solve this. (obviously, you'd have to rotate this cube and rescale it to match the line's rotation)

Hope this helps.

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 jimbobuk · Dec 18, 2009 at 04:18 PM 0
Share

do these gizmos require a script to set them up or are they just drag and drop? I've not come across these yet.

avatar image xaddict · Dec 20, 2009 at 01:16 PM 0
Share

yes they require a script that runs in the editor. you could use: function OnDrawGizmos() { Gizmos.DrawIcon(transform.position, "spawnPoint.png"); } to draw an icon. You can, with this function, also draw numerous other things that can be very helpful in the editor.

avatar image
1

Answer by spencer lindsay · Dec 18, 2009 at 02:46 AM

If this is during cutScene, why not just use a single camera and animate it in the Anim Editor?

If this is for in-game, What Peter said....

:)

:s.

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 jimbobuk · Dec 18, 2009 at 04:17 PM 0
Share

this is unity iphone, does that support the anim editor?

avatar image spencer lindsay · Dec 19, 2009 at 07:26 AM 0
Share

Pretty sure it does. We have a copy - it's just 3000 miles away right now and I can't look at it, but I would be shocked if the Animation Editor was disabled with the iPhone,... oh wait... damn. According to this page, Unity iPhone doesn't have the intergrated animation editor... weird..

http://unity3d.com/unity/licenses#iphone

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

No one has followed this question yet.

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

How can I simulate the "f" hotkey in the editor? 4 Answers

How to create an editor screenview like "camera preview" window for cameras? 4 Answers

Minimap clicking RTS style feature 3 Answers

Default Mouse Look Script 3 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