0
Under review

LushLOD Trees in VR - you have no main camera

Daniel Todorov 6 years ago updated by Aaron Brown 6 years ago 3

Hi Aaron,


Looking at your trees and the way they blend in VR is epic. I am having issues setting the whole system up. I get this message on the trees manager that says I dont have a camera enabled and it doesnt go away even after I enable a camera. Im running it on Unity 2018.1.0b12


Before posting I ran a few more tests and it works fine in an empty scene, but it doesnt in my main scene. Even after adding a camera called "Main Camera" it still didnt work. Any ideas?


Cheers


Danny

Under review

It could be an issue with the lastest beta... my last update was for Unity 2017. I've got an update in the works for when 2018 comes out of beta but in the mean time, can you copy / paste the entire error message, or screenshot it for me, and post it here?

Ok so I did it again and I tried to turn on the SteamVR where we have one of our camers and then it was fine. It still doesnt work with a random camera in the scene. I guess it would be nice to be able to keep our cameras off and still use the menues, but I guess that could cause a lot of other issues for you. Thanks for the fast response btw!

I see the line of code that's causing that error to appear. It's in _LushLODTreesManager.cs. If you just search for that text in that error, you'll find the line. It looks for Camera.main to exist.


Main camera documentation: https://docs.unity3d.com/ScriptReference/Camera-main.html


Here's another link about how to set a camera to be the main camera: https://answers.unity.com/questions/63221/how-to-set-main-camera.html


I'm pretty sure the trees won't work correctly if the main camera isn't set up properly... like... the transitions are centered around the main camera. So it's important to set the camera up with that tag to ensure that the transitions follow the camera correctly.