Error On Windows Standalone Build

atmuc

Member
My project works on the editor. When I try to run windows standalone build I get the following error on each frame. I cannot see fps arms and the rifle. I have no windows specific script on the character controller. What can cause this?

IndexOutOfRangeException: Index was outside the bounds of the array.
at Opsive.UltimateCharacterController.Game.KinematicObjectManager.SetCharacterMovementInputInternal (System.Int32 characterIndex, System.Single horizontalMovement, System.Single forwardMovement) [0x00001] in C:\Repository\Projects\Unity\Shooter\Assets\Standard Assets\Tools\Opsive\Opsive\UltimateCharacterController\Scripts\Game\KinematicObjectManager.cs:630
at Opsive.UltimateCharacterController.Game.KinematicObjectManager.SetCharacterMovementInput (System.Int32 characterIndex, System.Single horizontalMovement, System.Single forwardMovement) [0x00001] in C:\Repository\Projects\Unity\Shooter\Assets\Standard Assets\Tools\Opsive\Opsive\UltimateCharacterController\Scripts\Game\KinematicObjectManager.cs:619
at Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotionHandler.Update () [0x0002f] in C:\Repository\Projects\Unity\Shooter\Assets\Standard Assets\Tools\Opsive\Opsive\UltimateCharacterController\Scripts\Character\UltimateCharacterLocomotionHandler.cs:71
 
Are you able to tell us how to reproduce the error? I have not been able to reproduce it.
 
m_Characters has my player on unity editor. On windows build It does not have my player and characterIndex is -1 at SetCharacterMovementInputInternal function call , so I get that error. I have 6 UCC AI characters. I see AI characters on m_Characters. What can stop UCC character to be added to m_Characters on windows build?
 
There is no platform dependent code so there is likely an error before which prevents the character from calling KinematicObjectManager.RegisterCharacter within UltimateCharacterLocomotion.OnEnable.

If you can tell me how to reproduce it within a fresh project using the latest version I can definitely take a look but if not I would start debugging there.
 
I use UCC, UIS and Behavior Designer in my project. I to compare character parameters with UCC,UIS integration project. There so many parameters so I may missed something to compare.
 
There is no platform dependent code so there is likely an error before which prevents the character from calling KinematicObjectManager.RegisterCharacter within UltimateCharacterLocomotion.OnEnable.

If you can tell me how to reproduce it within a fresh project using the latest version I can definitely take a look but if not I would start debugging there.
I understand you for requested reproducible case, But in this case, it is not easy for me, as a senior software developer :) To learn all components and integrations I changed many parameters. I think I made bad things :) It is strange that it works on editor.

I found another error. I think my custom ability causes this.

NullReferenceException: Object reference not set to an instance of an object
at Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.Awake () [0x001cb] in C:\Repository\Projects\Unity\Shooter\Assets\Standard Assets\Tools\Opsive\Opsive\UltimateCharacterController\Scripts\Character\UltimateCharacterLocomotion.cs:317
 
in UltimateCharacterLocomotion m_Abilities has a null Ability. It is my custom Ability :) I just cloned RestrictPosition ability and made it to work with Transform object. I have no idea why it is null on windows build. I just add it like adding a buildin ability and I don't change any parameter.
 
I found the problem. I have Obfuscator on my project. I was enabled for the whole project. When I disabled it worked.
 
Top