Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 Raigex · Jul 27, 2012 at 03:21 PM · camerarenderingcamera.render

Is it possible to view two camera at the same time?

I have a problem. I am trying to have two cameras active at the same time and have them move in (slide in to view)

For instance i have two layouts and the camera on both is not showing them. Then i have a lerp function that slides the camera onto one layout and away from another (eg slideIn/SlideOut like on Android). The sliding works fine, my major problem is showing both slide in and slide out. What happens is that when i activate a camera it shows white background and a slide in but the other camera that is sliding out dissapears.

Is it possible to render both cameras at the same 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

2 Replies

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

Answer by Seth-Bergman · Jul 27, 2012 at 03:28 PM

Just use the "Normalized Viewport Rectangle" settings to set the part of the screen that the camera should be visible.

from a script you can access it as a Rect using Camera.rect

Camera.main.rect = new Rect(x,y,w,h);

so I figure using a simple lerp on the x value should achieve what you want

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 Raigex · Jul 27, 2012 at 03:37 PM 0
Share

So what your saying is that i would have a camera on each layout rectangle then set viewport as first layout, click a button then lerp though the rectangle until it shows the whole second layout?

avatar image Seth-Bergman · Jul 27, 2012 at 03:46 PM 1
Share

yes.. you could say for example:

camera1.rect = new Rect(camXvalue,0,Screen.width,Screen.height);

camera2.rect = new Rect(camXvalue+1,0,Screen.width,Screen.height);

then just lerp camXvalue from -1 to 0

untested, but you get the idea

avatar image Raigex · Jul 27, 2012 at 03:57 PM 0
Share

Thanks that is exctly what i needed.

Edit: I have been trying this for the last 2 hours but i cannot seem to get this. when i lerp the x value it the camera is snapped to the new one at the end of my tween function. Is it possible to set camera outisde of screen (eg: screenWidth = 480) then set x at -480? Edit again::

$$anonymous$$y problem was that ins$$anonymous$$d of the camX values of -1 to 0 i was using 480 to 0 , that is why it was jumping. After i switched to (0,1) range everytying was good.

avatar image Raigex · Jul 31, 2012 at 09:52 PM 0
Share

Also Seth, When i change the camera sizes from -1 to 0 or even 0-1 , I see the rectangle getting smaller (ins$$anonymous$$d of moving out of the screen) and my camera stays in the center (not moving the whole thing away like i would think it does. Do you know why something like that might happen.

avatar image Seth-Bergman · Aug 01, 2012 at 12:47 AM 0
Share

not quite sure what you mean.. the Rect struct goes:

(leftmostPoint,topmostPoint,width,height)

if you adjust the width or height, that should affect the size

the first two coordinates mark the position of the top-left corner, but do not affect size

changing the "size" parameter (of an orthographic camera), will not change any of this, it will simply change what the camera can see, (it's like a zoom), but the screen coordinates for the Rect will not be affected, just the "zoom" of what's inside it

Show more comments
avatar image
0

Answer by DaveA · Aug 01, 2012 at 12:52 AM

There is a set of scripts on the Script Wiki that does this and more. When that comes back online, you should grab it. Can do a bunch of different 'wipes'

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

7 People are following this question.

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

Related Questions

Rendering a 3D object within a specific area/bound? 1 Answer

How would you render a seemlessly wrapping scene? 1 Answer

Unity - Render XR game objects onto processed camera image 0 Answers

Best way to have a camera only see certain objects? 1 Answer

Stop Motion Camera Effect 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