Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
derikbr opened this issue Mar 11, 2022 · 1 comment

Comments

@derikbr
Copy link

derikbr commented Mar 11, 2022

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 derikbr changed the title ArgumentOutOfRangeException: Index was out of range. Must be non-negative ... Cinemachine.CinemachineBrain.UpdateFrame0 ArgumentOutOfRangeException: Index was out of range. Must be non-negative.. Mar 11, 2022
@NPatch
Copy link

NPatch commented Mar 26, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants