DisaronnoDog
New member
Hey, facing a particularly problematic issue at the moment...
It seems that whenever I change scenes , or reload the current scene, the Virtual Camera property of the "Third Person Cinemachine" view type in the Camera Controller becomes null; as a result, the Kinematic Object Manager's camera array also holds a null reference, throwing a NullReferenceException every tick and breaking any Kinematic characters.
This error is occurring in my scene "Level 1":
- If I run this scene directly from the editor, there is no problem, the game runs as intended; if the player dies and restarts the scene (By calling SceneManager.LoadScene(SceneManager.GetActiveScene().name)) the Null References occur.
- If I run the Main Menu Scene and load "Level 1" that way, then the Null References are thrown as soon as the scene loads for the first time.
I have played around with the Scene Execution order with no success. I have also tried implementing a method in the "CinemachineViewType" to set the m_VirtualCamera property at runtime, which works as intended, but does not fix the problem.
At this point I have bashed my head against the issue to the point of tunnel vision, and I was hoping that someone may be able to point out what I am missing!
Thanks all!
Initial Error:
NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Integrations.Cinemachine.CinemachineViewType.ChangeViewType (System.Boolean activate, System.Single pitch, System.Single yaw, UnityEngine.Quaternion characterRotation) (at Assets/Opsive/UltimateCharacterController/Integrations/Cinemachine/CinemachineViewType.cs:158)
Error thrown repeatedly afterwards:
NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Game.KinematicObjectManager.Update () (at Assets/Opsive/UltimateCharacterController/Scripts/Game/KinematicObjectManager.cs:833)
It seems that whenever I change scenes , or reload the current scene, the Virtual Camera property of the "Third Person Cinemachine" view type in the Camera Controller becomes null; as a result, the Kinematic Object Manager's camera array also holds a null reference, throwing a NullReferenceException every tick and breaking any Kinematic characters.
This error is occurring in my scene "Level 1":
- If I run this scene directly from the editor, there is no problem, the game runs as intended; if the player dies and restarts the scene (By calling SceneManager.LoadScene(SceneManager.GetActiveScene().name)) the Null References occur.
- If I run the Main Menu Scene and load "Level 1" that way, then the Null References are thrown as soon as the scene loads for the first time.
I have played around with the Scene Execution order with no success. I have also tried implementing a method in the "CinemachineViewType" to set the m_VirtualCamera property at runtime, which works as intended, but does not fix the problem.
At this point I have bashed my head against the issue to the point of tunnel vision, and I was hoping that someone may be able to point out what I am missing!
Thanks all!
Initial Error:
NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Integrations.Cinemachine.CinemachineViewType.ChangeViewType (System.Boolean activate, System.Single pitch, System.Single yaw, UnityEngine.Quaternion characterRotation) (at Assets/Opsive/UltimateCharacterController/Integrations/Cinemachine/CinemachineViewType.cs:158)
Error thrown repeatedly afterwards:
NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Game.KinematicObjectManager.Update () (at Assets/Opsive/UltimateCharacterController/Scripts/Game/KinematicObjectManager.cs:833)