Demo scene error with UFPS + TPC

CitrioN

New member
Hello,

I'm getting the following error when I run the demo scene and click on any of the sections such as 'Locomotion':
Code:
NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Demo.DemoManager.ActivateDemoZone (Opsive.UltimateCharacterController.Demo.DemoManager+DemoZone demoZone, System.Boolean teleport) (at Assets/Opsive/UltimateCharacterController/Demo/Scripts/DemoManager.cs:401)
Opsive.UltimateCharacterController.Demo.DemoManager.Teleport (System.Int32 index) (at Assets/Opsive/UltimateCharacterController/Demo/Scripts/DemoManager.cs:461)
Opsive.UltimateCharacterController.Demo.UI.ZoneSelection.LoadZone (System.Int32 index) (at Assets/Opsive/UltimateCharacterController/Demo/Scripts/UI/ZoneSelection.cs:218)
Opsive.UltimateCharacterController.Demo.UI.ZoneElement.UnityEngine.EventSystems.IPointerClickHandler.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at Assets/Opsive/UltimateCharacterController/Demo/Scripts/UI/ZoneElement.cs:85)
UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/ExecuteEvents.cs:57)
UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/ExecuteEvents.cs:272)
UnityEngine.EventSystems.EventSystem:Update() (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:501)

I have installed both the UFPS and ThirdPersonController (v3.0.4) assets from the asset store in a fresh project in 2021.3.15f1 which is the latest LTS version at the time of writing this.
Went through all the steps to setup the project by having it add both the layers and input mappings.
I also did add the TextMeshPro essentials from the popup menu.

I checked the code with a break point at that line and the m_PerspectiveToggle is indeed null.
There is also no null check for this in the method above to prevent this from happening.
Scripting defines are THIRD_PERSON_CONTROLLER, FIRST_PERSON_CONTROLLER, TEXTMESH_PRO_PRESENT.

This seems to only appear if I have both of the controllers installed but not if either is installed without the other.

Kind regards,
CitrioN
 
With both imported to have the switch functionality you can use the uploaded ultimate demo scene from the downloads page.


That doesn't fix it for me.
I do get the following with the uploaded demo scene as well as the previously posted one:
Code:
UnassignedReferenceException: The variable m_Character of DemoManager has not been assigned.
You probably need to assign the m_Character variable of the DemoManager script in the inspector.
UnityEngine.Object.Instantiate[T] (T original) (at <685c48cf8f0b48abb797275c046dda6a>:0)
Opsive.UltimateCharacterController.Demo.DemoManager.Start () (at Assets/Opsive/UltimateCharacterController/Demo/Scripts/DemoManager.cs:204)
 
This still doesn't fix it for me. I'm using the version 3.0.5 for both controllers and the most recent download from the website for the demo scene.
I still get the following error when I start the demo scene and click on Locomotion:

Code:
NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Demo.DemoManager.ActivateDemoZone (Opsive.UltimateCharacterController.Demo.DemoManager+DemoZone demoZone, System.Boolean teleport) (at Assets/Opsive/UltimateCharacterController/Demo/Scripts/DemoManager.cs:401)
Opsive.UltimateCharacterController.Demo.DemoManager.Teleport (System.Int32 index) (at Assets/Opsive/UltimateCharacterController/Demo/Scripts/DemoManager.cs:461)
Opsive.UltimateCharacterController.Demo.UI.ZoneSelection.LoadZone (System.Int32 index) (at Assets/Opsive/UltimateCharacterController/Demo/Scripts/UI/ZoneSelection.cs:218)
Opsive.UltimateCharacterController.Demo.UI.ZoneElement.UnityEngine.EventSystems.IPointerClickHandler.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at Assets/Opsive/UltimateCharacterController/Demo/Scripts/UI/ZoneElement.cs:85)
UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/ExecuteEvents.cs:57)
UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/ExecuteEvents.cs:272)
UnityEngine.EventSystems.EventSystem:Update() (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:501)

m_PerspectiveToggle is still null when checking it with a break point.
 
The version 3.0.5 upload didn't work - one more download and this time it'll work correctly.
 
Top