26-02-2020, 08:38 PM
I've done some more testing and the problem doesn't seem to be related SortedPoints being unitialized. More details from additional testing:
- GameObjects with Skinned Cloth are created and their parent is immediately deactivated. Several frames later they are re-activated and the game/editor crashes.
- The crash is occuring when the solver is run after activating gameobjects with Skinned Cloth. (I mistakenly thought it was on deactivation in my previous post)
- Changing when the activation happens doesn't solve the problem. Neither WaitForEndOfFrame or WaitForFixedUpdate prevent crashes.
- The crash occurs randomly. Less than 50% of the time, but frequently enough that I can easily reproduce it.
- The crash does NOT seem to happen when instantiating the same model without activation/deactivation and outside of any coroutine.
- I added logging to ObiSkinnedCloth and can see that it is copying 1227 from bakedVertices to sortedPoints before the crash.