r/UnityHelp • • Apr 13 '22

SkinnedMeshedRenderer crashing Unity when using SetBlendShapeWeight

Hey everyone, I've been googling around for a while now and am not seeing this issue anywhere else online, so I decided to make my first post here. I am having an issue in my game that crashes Unity on the second "play". The first time I hit play, the game runs fine, but it's the second time I do it that it crashes every single time.

My problem is with the SkinnedMeshedRenderer.SetBlendShapeWeight() method. If I disable this single line of code everything is fine. So I'm extremely confident that SetBlendShapeWeight() is the culprit. I'm currently using SetBlendShapeWeight() when a character in my game equips a new piece of gear, like a shirt. The function will adjust the shirt to fit the character's size. We essentially have a large and small character.

Does anyone here know why this might happen, or have any insight on to the proper way to use this function? Thanks in advance!

2 Upvotes

0 comments sorted by