Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 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 jeango · Oct 17, 2016 at 10:19 AM · camerarenderinggizmosgame view

Multiple Cameras: why are my gizmos not rendered in the game view

Hi, I'm making a space shooter game, where my spaceship's movement is restrained within specific bounds. I draw a gizmo to visualise these bounds, and so far it worked perfectly.

But now I want to add a UI, and since my game is orthographic, but I want my UI to be in perspective, I use a camera render mode for my canvas.

Thus I created a new camera (called it "UICam", and the other is "GameCam"), set it to depth only, made sure the depth is higher than GameCam's, and the UI displays nicely, as though it was an overlay.

BUT: my gizmos are no longer rendered in the game view. I don't understand why. Since I'm in "depth only" it doesn't make any sense that the UICam overwrites the gizmos that are rendered by GameCam.

I tried to set UICam to be Orthographic, thinking maybe that would be the issue, but to no avail. Note that if I set the render mode to "Overlay" the gizmo displays just fine. I guess there's something I don't understand about how Gizmos are rendered.

Note: yes, I did enable Gizmos in the game view

To be clear, because some ppl are apparently confused, when I talk about the "game view" I'm talking about the Game Window in the editor, not in the actual final build of the game.

Here's the game window when UICam is disabled (you can see the green lines from the Gizmo being drawn) The Game window when UICam is disabled

Here's the game window when UICam is enabled (Gizmo no longer rendered) alt text

screen-shot-2016-10-17-at-171525.png (44.3 kB)
screen-shot-2016-10-17-at-171726.png (43.7 kB)
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

1 Reply

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

Answer by b1gry4n · Oct 17, 2016 at 02:19 PM

Gizmos are used for debugging. They do not get built into the final game.

https://docs.unity3d.com/ScriptReference/Gizmos.html

If you want gizmos in your final build, you need to create your own solution, like THIS

Downvoting me because you werent clear in your initial question isnt the right way to get the help youre looking for, but since i am such a kind soul...

Your gizmos arent showing up in game view (in the editor) because the gizmos are drawn using the top most camera, set to perspective in your case, and the gizmos arent in the shot. Im not sure how youre creating these gizmos, but you need to make sure the top most camera (highest depth) can see them.

Notice in my screenshots how the gizmos are "offset". You most likely need to adjust the orthographic cameras "size" or the perspective cameras FOV, and guesstimate, since lining up perspective to orthographic perfectly is near impossible. The problem lies with the combination of perspective and orthographic views not lining up.

The easiest solution is to just make a 3rd camera that draws nothing, on the highest depth, and use the same settings as your orthographic camera

OTHRO UI CAM OFF: alt text

ORTHO UI CAM ON:

alt text


uioff.jpg (130.5 kB)
uion.jpg (130.4 kB)
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 jeango · Oct 17, 2016 at 02:43 PM -1
Share

I don't want to see the gizmo in the final game, I want to see the gizmo in the game view in the Unity Editor (which you absolutely can do by clicking the "Gizmo" button in the game view).

avatar image jeango · Oct 18, 2016 at 01:02 PM 0
Share

I apologize for the undeserved downvote. I thought that my question was very clear, where apparently it was not.

That idea of a 3rd camera drawing nothing is brilliant. Thanks

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

78 People are following this question.

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

Related Questions

Gizmos are rendering twice 2 Answers

very flat fbx objects disappear in game view? 2 Answers

How to create texture from multiple sprite in unity2d? 0 Answers

Dissable lights per camera? 2 Answers

Rendering the same Render Texture differently to separate cameras 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