SetParent() with Animator occurs Crash.

It often happens on Android & iPhone.

Step.

  • GameObject(A) is complex nested and has child with Animator.

  • The parent is “empty GameObject” and inactive in hierarchy. (but It doesn’t matter with enabled or disabled. It occurs same crash.)

  • Try to GameObject(A).SetParent(parent).

  • then crash sometime.

This seems to be caused a crash in thread_1. but, I can’t symbolicate that.

And thread_0 always print this stack. SetParent() → Animation… something.
I think that it is associated with thread_1’s crash.

How can I fix it? plz help me!

Edit :
I move this thread to Answers.
http://answers.unity3d.com/questions/1195440/crash-by-setparent-with-animator.html

Try running with exception handling turned on “slow and safe” i the build settings. Also, have a look in the editor for any Excpetions that might occur. You can also try and set the scripting backend to mono and see if that works. For us it sometimes did a little diffirence and we where able to fix or work around issues doing stuff like this.

Thx for your advice. I will try it!

Unfortunately, not affect for me.
Is there any other suggestions?
This problem is hitting my head for a week!

Got the same problem with Unity 5.3.5p1. Moving/rotating/doing some other stuff to a character with an Animator in a specific scene crashes the editor. Disabling either the script doing the moving or the Animator component prevents the crash.

Bug number 802076 (couldn’t send a repro project, but attached the dump logs and the script).

Disable the Animator component seems work.
Thank you for the great information!

It’s not working. still occurs error. I think, It’s not only related with SetParent().
I don’t understand this situation. then now I try to make sample project.

At least in my case it’s fixed in 5.3.5p3.