BoatAttack icon indicating copy to clipboard operation
BoatAttack copied to clipboard

ArgumentOutOfRangeException: Index was out of range. Must be non-negative..

Open derikbr opened this issue 2 years ago • 1 comments

Does anybody know how to solve this? I opened the project in the correct version and the error continues. After compiling the game does not load the scene of "level_Island"

ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) (at <695d1cc93cca45069c528c15c9fdd749>:0) System.ThrowHelper.ThrowArgumentOutOfRangeException () (at <695d1cc93cca45069c528c15c9fdd749>:0) **Cinemachine.CinemachineBrain.UpdateFrame0** (System.Single deltaTime) (at Library/PackageCache/[email protected]/Runtime/Behaviours/CinemachineBrain.cs:690) Cinemachine.CinemachineBrain.ManualUpdate () (at Library/PackageCache/[email protected]/Runtime/Behaviours/CinemachineBrain.cs:349) GameplayIngredients.Editor.LinkGameView.UpdateCinemachinePreview (System.Boolean value) (at Library/PackageCache/[email protected]/Editor/GameViewLink/LinkGameView.cs:247) GameplayIngredients.Editor.LinkGameView.set_CinemachineActive (System.Boolean value) (at Library/PackageCache/[email protected]/Editor/GameViewLink/LinkGameView.cs:58) GameplayIngredients.Editor.LinkGameView.OnPlayModeChanged (UnityEditor.PlayModeStateChange state) (at Library/PackageCache/[email protected]/Editor/GameViewLink/LinkGameView.cs:104) UnityEditor.EditorApplication.Internal_PlayModeStateChanged (UnityEditor.PlayModeStateChange state) (at <ad50112e30b445fdbf80d5814c3cbcf6>:0)

derikbr avatar Mar 11 '22 20:03 derikbr

Yeah, go to File->Build Settings and check the checkbox next to that scene. The problem was that the scene was not included in the game, therefore the utility class which searches the scene index by name, on runtime, did not find the scene registered, so it returned -1, hence the exception you're getting.

NPatch avatar Mar 26 '22 12:03 NPatch