Obi Official Forum
Bug / Crash IndexOutOfRange in ClothProxy on Android - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Cloth (https://obi.virtualmethodstudio.com/forum/forum-2.html)
+--- Thread: Bug / Crash IndexOutOfRange in ClothProxy on Android (/thread-2788.html)



IndexOutOfRange in ClothProxy on Android - JanikH - 04-03-2021

Hi,

when running our game on Android we're currently running into the following exception:
Code:
IndexOutOfRangeException: Index was outside the bounds of the array.
  at Obi.ObiClothProxy.UpdateSkinning (Obi.ObiActor actor) [0x002ab] in ...\Assets\Obi\Scripts\Cloth\Rendering\ObiClothProxy.cs:132
  at Obi.ObiClothRendererBase.UpdateRenderer (Obi.ObiActor actor) [0x0012b] in ...\Assets\Obi\Scripts\Cloth\Rendering\ObiClothRendererBase.cs:191
  at Obi.ObiActor.Interpolate () [0x0010d] in ...\Assets\Obi\Scripts\Common\Actors\ObiActor.cs:1189
  at Obi.ObiSolver.Interpolate (System.Single stepTime, System.Single unsimulatedTime) [0x000a7] in ...\Assets\Obi\Scripts\Common\Solver\ObiSolver.cs:1622
  at Obi.ObiUpdater.Interpolate (System.Single stepDeltaTime, System.Single accumulatedTime) [0x0002f] in ...\Assets\Obi\Scripts\Common\Updaters\ObiUpdater.cs:110
  at Obi.ObiFixedUpdater.Update () [0x00007] in ...\Assets\Obi\Scripts\Common\Updaters\ObiFixedUpdater.cs:62

This does not occur when running in the editor.
We're using ObiCloth 6.0.1 with Unity 2020.2.4f1.
I made sure to regenerate the blueprint and rebind the skin map.

Any pointers as to what the issue may be?


RE: IndexOutOfRange in ClothProxy on Android - josemendez - 04-03-2021

That line simply reads the mesh tangent vectors, which makes me suspect your mesh has none in the build. If you have this flag enabled:

https://docs.unity3d.com/ScriptReference/PlayerSettings-stripUnusedMeshComponents.html?_ga=2.93604894.2005016332.1583224178-1954860595.1583224178

Unity will remove all mesh data that's not used in shaders at build time. This will strip away tangents, vertex colors, etc. even if some scripts use them. Will also break shaders/lighting if you switch shaders at runtime. Personally not a big fan of it :/.

Try disabling this flag if you have it enabled.


RE: IndexOutOfRange in ClothProxy on Android - JanikH - 04-03-2021

Thanks for the quick response! That was exactly the problem!
I'm just a bit confused as to why the issue appeared only now...
Oh well, Unity I guess.


RE: IndexOutOfRange in ClothProxy on Android - josemendez - 04-03-2021

(04-03-2021, 05:52 PM)JanikH Wrote: Thanks for the quick response! That was exactly the problem!
I'm just a bit confused as to why the issue appeared only now...
Oh well, Unity I guess.

This setting removes mesh data at build time. So the data is there in editor, but once you build... poof! Your mesh tangents are gone.

So yes, enabling this reduces memory usage, but breaks scripts and shaders. So not that useful in many cases.