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 Ross_B · Nov 21, 2013 at 07:35 AM · cameraerrorgame view

Game view fails to work after wierd casting error.

Hello Everyone.

I was busy Creating an editor script when I got a seemingly unrelated error message:

"pptr cast failed when dereferencing Casting from DefaultAsset to Shader!".

Since this error message the game view is completely blanked out with a default blue color making it impossible to test the game.

  • I removed the script that I was working on when the error occurred but nothing changed.

  • I have a camera in the scene that is rendering to the default render texture. It's preview shows all the game objects as expected.

  • I have set the camera's background to white but the game view still stays the default blue.

  • The camera's culling mask is set to "Everything".

  • The camera's tag is "MainCamera".

  • I have restarted Unity and the computer multiple times.

This error seems to be a known issue with Unity but I cant find any reports of it affecting the editor. The error may just be a coincidence but that seems unlikely.

How can I fix the game view? Am I missing something obvious?

Any help would be greatly appreciated. :)

Thanks - Ross

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

Answer by Ross_B · Nov 22, 2013 at 12:11 PM

Well. That was silly.

Basically The script I was writing created a Camera in a GameObject with hideFlags.HideInHierachy enabled. When i closed the window it was supposed to delete the gameObject but the first time I closed it I used Destroy() instead of destroyImmediate().

My main camera had a depth of -1 which meant that the hidden camera took priority. The net result was a phantom camera that took priority over every camera below 0 depth. Since the near clipping plane of the phantom camera was too far (for my pseudo-2D game) It left me with a lovely blue Game view.

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

17 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

Related Questions

Please help to have a Game View running in multiple displays: one main display plus two external target displays. 1 Answer

How to make camera position relative to a specific target. 1 Answer

Camera.current.Render() renders AND makes a NullReferenceException error 0 Answers

Screen position out of view frustum error, cannot solve? 1 Answer

How to freeze camera? 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