Closed adrian-j-programmer closed 3 years ago
This happened because the generation process was in a coroutine, and the skeleton and mesh could get out of sync if rebuilding while it was in the middle of generating somehow. I created new versions of the generator that were not built with coroutines, as well as doing a bunch of null checks. With this new non-coroutine version in place, generation time seems to have improved around 8% in the editor. This will be in 2.11.
Describe the bug When using the DynamicCharacterAvatar.ChangeRace to switch between different races quickly, UMAData of the avatar can lose its reference to the generator, causing a runtime error. In addition to that, when switching races, the CharacterUpdated event is not raised, making it impossible to protect the UMA from having its race changed too often.
Environment (please complete the following information):
To Reproduce Steps to reproduce the behavior:
Expected behavior It should be possible either switch races as often as one wishes to, or to use the CharacterUpdated callback (or other) to programmatically protect UMA from being forced into an invalid state.
Additional context I was not able to reproduce this issue when switching between the default male and female races. My custom race used a custom skeleton, which had to be rebuilt on every race change. When changing between races, I passed on the keepBodyColors and keepDNA flags.