Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug / Crash  IndexOutOfRange in ClothProxy on Android
#1
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?
Reply
#2
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...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.
Reply
#3
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.
Reply
#4
(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.
Reply