Bug :
1. Create a new project with Unity 2021.3.13f1.
2. Download and install Third Person Controller 3.0.3, Ultimate Inventory System 1.2.12, and Integration.
3. Open Integration Demo scene.
4. Check AutoSpawnDestroyRuntimeCharacterItems.
5. Add an item with Animator to Equippable.
6. Run the scene.
Error:
NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Character.ChildAnimatorMonitor.SnapAnimator (System.Boolean executeEvent) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/ChildAnimatorMonitor.cs:253)
Opsive.UltimateCharacterController.Character.ChildAnimatorMonitor.OnImmediateTransformChange (System.Boolean snapAnimator) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/ChildAnimatorMonitor.cs:640)
Opsive.Shared.Events.InvokableAction`1[T1].Invoke (T1 arg1) (at <f8e88e939b08494e9e6a74df2ca4dcad>:0)
Opsive.Shared.Events.EventHandler.ExecuteEvent[T1] (System.Object obj, System.String eventName, T1 arg1) (at <f8e88e939b08494e9e6a74df2ca4dcad>:0)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.OnEnable () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:454)
This is caused by ChildAnimatorMonitor.Awake() being called before AnimatorMonitor.Awake() when Instantiate the prefab.
1. Create a new project with Unity 2021.3.13f1.
2. Download and install Third Person Controller 3.0.3, Ultimate Inventory System 1.2.12, and Integration.
3. Open Integration Demo scene.
4. Check AutoSpawnDestroyRuntimeCharacterItems.
5. Add an item with Animator to Equippable.
6. Run the scene.
Error:
NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Character.ChildAnimatorMonitor.SnapAnimator (System.Boolean executeEvent) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/ChildAnimatorMonitor.cs:253)
Opsive.UltimateCharacterController.Character.ChildAnimatorMonitor.OnImmediateTransformChange (System.Boolean snapAnimator) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/ChildAnimatorMonitor.cs:640)
Opsive.Shared.Events.InvokableAction`1[T1].Invoke (T1 arg1) (at <f8e88e939b08494e9e6a74df2ca4dcad>:0)
Opsive.Shared.Events.EventHandler.ExecuteEvent[T1] (System.Object obj, System.String eventName, T1 arg1) (at <f8e88e939b08494e9e6a74df2ca4dcad>:0)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.OnEnable () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:454)
This is caused by ChildAnimatorMonitor.Awake() being called before AnimatorMonitor.Awake() when Instantiate the prefab.