Supplied NxActorDesc is not valid

Hey,

Ok so i have had this weird problem for quite some time, which i just found the solution to and which seems to be a unity bug so here goes…

I have a cylinder mesh with a capsule collider, a rigidbody and 1 attached script to it. The only thing the script does is disable the game object on collision. As soon as the script disables the game object i get this error in console:

Supplied NxActorDesc is not valid. createActor returns NULL.

It doesnt crash the game or anything but i just get this error, and i get some weird behaviour when i try the game on my ipad…

I tried several different methods to fix the error, e.g disabling the mesh in a later frame, changing collider types, using my own model instead of the builtin cyldiner mesh, etc… but nothing worked…

but i just managed to fix the the problem if i add a mesh collider with the capsule collider and then disable the mesh collider…

i hope team unity looks into this for a future fix…

I just ran into this error when creating a new object in code, adding a rigidbody and collider, and then disabling the object (with SetActive) on the same frame. The solution that worked for me was to swap the order of creating the rigidbody and collider. If I create the collider first, then the rigidbody, the error doesn’t come up.

Hopefully this is useful to someone. :slight_smile:

Delete both of the objects in question and then create them again in the reverse order.

I ran into this bug yesterday. GameObject, rigidbody, capsule collider. Nothing fancy. What was happening was I was using iTween to scale the object to 0,0,0. When I scaled to .1,.1,.1 the error went away. Suspect PhysX does not like 0 volume colliders and they just need a nicer error message.