Maya import...

I have set up a door rig to open and close via various scripts (the user clicks on the doorhandle to open the door). The problem is I want to keep the whole rig as a PreFab and at the moment I can’t seem to do that.

Here is the hierarchy in Maya:

and here is the hierarchy in the Hierarchy viewport:

and finally, in the Project viewport:

As you can see the Hierarchy view correctly reflects the rig as it is in Maya, however, the hierarchy in the Project viewport doesn’t seem to be the same (is it meant to?). This wouldn’t be a problem except I can’t seem add a script to the doorhandle in the Project viewport which I need to do in order to keep the door as a Prefab. The script adds fine in the Hierarchy viewport, but if I add it there the connection to the original Maya file breaks.

Am I missing something?

many thanks,
Richard.

Prefabs in the project view show only the first level in the hierarchy.
When you instantiate the prefab you of course see the full hierarchy. It just isn’t drawn in the project view to avoid confusion.

Prefabs can not add components/scripts/child transforms at this point.
This is a current limitiation of the prefab system.

At the present time your best bet is to:

  1. create a new prefab in unity.
  2. drag the maya prefab in to the hierarchy view
  3. Drag the instantiated maya prefab onto the newly created prefab

Now you can edit the prefab in any way you like. (Instantiate and upload changes to prefab is your friend)

When you change the mesh in maya it will still change in your prefab but if you eg. move the object or add new objects it will not be reflected in the new prefab.