Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Transform error, when trying to change parent

Discussion in 'Editor & General Support' started by azeitler, Mar 24, 2009.

  1. azeitler

    azeitler

    Joined:
    May 14, 2008
    Posts:
    162
    I updated to 2.5 an suddenly one of my Editor scripts does not work any more.
    There is some weirdness and yet unseen error messages when my script tries to change a gameobjects parent. The transform is all messed up, there are errors in set_position, set_parent and overall accessing the transform (Nullreference).

    What could cause this?

    this is caused in a ExecuteInEditMode Script that raycasts to place the object on the ground below.


     
  2. azeitler

    azeitler

    Joined:
    May 14, 2008
    Posts:
    162
    I am still getting this series of errors when trying to set the parent of a gameObject's transform component:

    and after that the GameObject becomes invalid and a NullReferenceException is thrown.

    Please give some advice - urgently!
     
  3. azeitler

    azeitler

    Joined:
    May 14, 2008
    Posts:
    162
    Am I the only one experiencing this problem?!
     
  4. Toxic Blob

    Toxic Blob

    Joined:
    Jun 8, 2010
    Posts:
    18
    I just had the "Unable to create broadphase entity.” error. Not sure what is causing it…. Time.timeScale is currently set to 0 and I had been away from the game for 5 minutes. Hmm...
     
  5. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    I am occasionally getting the same error when changing the parent of an object (from editor script). I do not understand why there is any sort of actor initialisation taking place because the object already exists.

    Full errors:
    • Unable to create broadphase entity.
    • Actor Initialisation failed: returned NULL.
    • Could not create actor. Maybe you are using too many colliders or rigidbodies in your scene?
    I can safely say that there are not many colliders or rigidbodies in my scene. When editing unwanted objects are destroyed using `Object.DestroyImmediate` as recommended in the documentation.

    When this error does rear its ugly head, it recurs until I restart Unity.
     
  6. yahodahan

    yahodahan

    Joined:
    Apr 26, 2009
    Posts:
    1,380
    Same exact issue as numberkruncher...except I'm doing some dirty dirty things a la mesh instantiating in the editor, so I expect a few errors here and there- just that this one makes zero sense as far as I can see.

    Anyone have any luck finding the root cause of this? I've been using my editor script for a week-ish now, always yells at me about the meshes, but only recently did the "broadphase..." error start popping up.
     
  7. thebarryman

    thebarryman

    Joined:
    Nov 22, 2012
    Posts:
    130
    I'm starting to get frustrated at a lot of performance issues resulting from my Editor scripts for generating procedural levels. This is the latest bizarre one that's popped up, and I haven't really found much help on the others either.
     
  8. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    I did not find a solution for this issue, though since recent versions of Unity (3.5.7 and 4.0) I have not experienced this error at all.