question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unity Throws assertions for main camera

See original GitHub issue

Overview

In 2017.2.0f3 and 2017.2.0p1 unity throws assertions for the main camera when checking is the display is opaque.

Assertion failed: Main camera does not exist!
UnityEngine.XR.WSA.HolographicSettings:get_IsDisplayOpaque

Steps for work around

Use the MRTP editor builds

Unity Editor Version

2017.2.0f3 and 2017.2.0p1

Mixed Reality Toolkit Release Version

db59a1c7fa0c0c463466028c5f3e70088bbfda52

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
markgrossnicklecommented, Dec 21, 2017

For anyone else hitting this… wrapping a Application.isEditor check around each call to prevent the code from getting hit in the editor is a messy but working solution.

0reactions
keveleighcommented, Aug 29, 2018

@StarWardo Unfortunately, this is a Unity bug with seemingly many versions of 2017.2. The Toolkit and Microsoft now recommend Unity’s LTS branch, 2017.4, for WMR development.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Assert - Scripting API
The Assert class contains assertion methods for setting invariants in the code. ... Assert throws exceptions whenever an assertion fails.
Read more >
How to write unit tests that can be visually inspected?
I'm just using what Unity provides for unit testing, and the screenshot shows the default test hierarchy view from the editor, so I...
Read more >
Why does checking if Camera.Main is non-null generate an ...
I'm trying to add a line in my character controller that checks if the main camera exists, and turns the character relative to...
Read more >
OnBecameInvisible() Throwing error when game stops
It says “Assertion failed on expression: 'go.IsActive() && go.GetTag() != 0'”. This happens only when I exit play mode. And there is another ......
Read more >
Unity 5.1 Assertion Library
If you want asserts to be included in your build (asserts are not exceptions by default) then all you need to do is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found