Search Unity

SetParent() with Animator occurs Crash.

Discussion in 'Scripting' started by sdf_eee, May 30, 2016.

  1. sdf_eee

    sdf_eee

    Joined:
    May 30, 2015
    Posts:
    55
    It often happens on Android & iPhone.

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

    2. The parent is "empty GameObject" and inactive in hierarchy. (but It doesn't matter with enabled or disabled. It occurs same crash.)

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

    4. 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
     
    Last edited: May 31, 2016
  2. crispybeans

    crispybeans

    Joined:
    Apr 13, 2015
    Posts:
    210
    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.
     
  3. sdf_eee

    sdf_eee

    Joined:
    May 30, 2015
    Posts:
    55
    Thx for your advice. I will try it!
     
  4. sdf_eee

    sdf_eee

    Joined:
    May 30, 2015
    Posts:
    55
    Unfortunately, not affect for me.
    Is there any other suggestions?
    This problem is hitting my head for a week!
     
    Last edited: May 31, 2016
  5. iivo_k

    iivo_k

    Joined:
    Jan 28, 2013
    Posts:
    314
    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).
     
  6. sdf_eee

    sdf_eee

    Joined:
    May 30, 2015
    Posts:
    55
    Disable the Animator component seems work.
    Thank you for the great information!
     
  7. sdf_eee

    sdf_eee

    Joined:
    May 30, 2015
    Posts:
    55
    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.
     
  8. iivo_k

    iivo_k

    Joined:
    Jan 28, 2013
    Posts:
    314
    At least in my case it's fixed in 5.3.5p3.