Jump to content

Water System: The player was null or no camera was found in your scene


mroshaw
 Share

Go to solution Solved by Bryan,

Recommended Posts

Hi!

I've created a brand new project in Unity 2021.3, added Gaia, created a terrain. I've then created an Invector 3rd person shooter controller, using the Gaia Manager to configure a "Custom" player controller.

Whenever I start the scene, I get a warning from PW Water:

Water System: The player was null or no camera was found in your scene.
UnityEngine.Debug:LogWarning (object)
Gaia.PWS_WaterSystem:ConfigurePlayerAndCamera () (at Assets/Procedural Worlds/Gaia/Scripts/Water System/Reflections/PWS_WaterSystem.cs:1256)
Gaia.PWS_WaterSystem:LoadResources () (at Assets/Procedural Worlds/Gaia/Scripts/Water System/Reflections/PWS_WaterSystem.cs:1200)
Gaia.PWS_WaterSystem:StartAndOnEnabled () (at Assets/Procedural Worlds/Gaia/Scripts/Water System/Reflections/PWS_WaterSystem.cs:300)
Gaia.PWS_WaterSystem:OnEnable () (at Assets/Procedural Worlds/Gaia/Scripts/Water System/Reflections/PWS_WaterSystem.cs:230)
  1. In the Gaia Runtime component, the camera is assigned ("Main Camera").
  2. Under "Water Surface", in the "PWS_Water System" component, the Player is assigned ("vShooterController Instance").
  3. The camera is the only camera in the scene and has the tag "MainCamera".
  4. Debugging, this is the line that's returning null:
    m_RenderCamera = SceneView.lastActiveSceneView.camera;

    Which I think is in turn due to Application.isPlaying returning false, even when entering play mode via the editor.

Any idea what I'm missing here?

Thanks again!

Link to comment
Share on other sites

  • Solution
13 hours ago, mroshaw said:

Hi!

I've created a brand new project in Unity 2021.3, added Gaia, created a terrain. I've then created an Invector 3rd person shooter controller, using the Gaia Manager to configure a "Custom" player controller.

Whenever I start the scene, I get a warning from PW Water:

Water System: The player was null or no camera was found in your scene.
UnityEngine.Debug:LogWarning (object)
Gaia.PWS_WaterSystem:ConfigurePlayerAndCamera () (at Assets/Procedural Worlds/Gaia/Scripts/Water System/Reflections/PWS_WaterSystem.cs:1256)
Gaia.PWS_WaterSystem:LoadResources () (at Assets/Procedural Worlds/Gaia/Scripts/Water System/Reflections/PWS_WaterSystem.cs:1200)
Gaia.PWS_WaterSystem:StartAndOnEnabled () (at Assets/Procedural Worlds/Gaia/Scripts/Water System/Reflections/PWS_WaterSystem.cs:300)
Gaia.PWS_WaterSystem:OnEnable () (at Assets/Procedural Worlds/Gaia/Scripts/Water System/Reflections/PWS_WaterSystem.cs:230)
  1. In the Gaia Runtime component, the camera is assigned ("Main Camera").
  2. Under "Water Surface", in the "PWS_Water System" component, the Player is assigned ("vShooterController Instance").
  3. The camera is the only camera in the scene and has the tag "MainCamera".
  4. Debugging, this is the line that's returning null:
    m_RenderCamera = SceneView.lastActiveSceneView.camera;

    Which I think is in turn due to Application.isPlaying returning false, even when entering play mode via the editor.

Any idea what I'm missing here?

Thanks again!

We are looking into the latest release of the LTS. 
I will check into this. Have you tried to leave the camera un assigned? 
It should pick the camera up as well this way. 

 

Link to comment
Share on other sites

Thanks Bryan. The code runs a second time, and picks up the camera, so I guess it's either just a timing issue or oddness in 2021.3 LTS. Either way, it doesn't seem to have any material impact - only on my OCD and desire for a clean console at runtime! 🙂

  • Like 1
Link to comment
Share on other sites

Thats good, you could try to assign the camera and save the project and restart. 
Unity works in mysterious way sometimes lol

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...