Game Development Reference
In-Depth Information
Figure 5.15 Problem area found in a
scene once placed in Unity.
Warnings and Pitfalls
In this case the problem
was in my construction
technique. As I was
creating the doors, I
duplicated a door and
then scaled it using X =
-1. The tricky thing about
this is that in Maya, the
normals look correct
but in Unity they do
not. The problem here is
that by using the Scale
X = -1 method, that
mesh ends up with an
Opposite tag that can
be tough to track down.
A better method is to use
Mesh>Mirror Geometry
when needing this sort
of duplication.
To fix this problem, either
reconstruct using the
Mirror Geometry method
(and then separating
the duplicate from the
original (Polygons>Mesh>
Separate)) or, take the
errant copy and combine
it with the original. Then
the normals will appear
as they will in Unity.
Reverse the normals that
are reversed (Polygons
>Normals> Reverse), and
separate the two doors.
Be sure to rename the
newly separated meshes
appropriately.
Step 22: In Maya, open the Maya file EntryWay.mb ( not the .fbx we
exported). Fix any geometry or normals problems.
Step 23: Export manually from Maya again (File>Export All), although
this time turn off Embed Media in the File Type Specific Options section of
the Export All dialog box. Be sure to overwrite the old EntryWay.fbx in the
Assets folder of your Unity project file.
Why?
Because all the textures have already been imported into Unity, there is
no need to include them in this new version of the .fbx. It will save loads
of time in exporting and even more importing. By overwriting the old
EntryWay.fbx, the changes made here will automatically fix themselves in
the instances placed in the scene.
Conclusion
So there it is—exporting manually from Maya and importing to Unity.
I haven't had a project yet where I didn't have to do a little bit of tweaking
to a level once it was imported. But because the process is so quick, it
really is quite painless to make the necessary adjustments.
Now the game is playable enough to walk around the scene. It still has a lot of
problems (no lighting, the sky is that strange flat blue, etc.), but not to fear; in
the next chapters, we will use some of Unity's built-in asset creation tools to
give some more life to the scene.
Homework and Challenges
Challenge 1: If you've been building the hallway (along with UV and
texture), export the hallway from Maya and create a new scene within Unity
to place it in (save the file as Scene-Hallway). Walk through the level to test.
Search WWH ::




Custom Search