Skip to content

Unity tips and notes

Michael Hulse edited this page Sep 5, 2018 · 3 revisions

That is, macOS-centric notes …

Get Unity version of project without opening it

Open any *.asset file in TextEdit. For example: Assets/qezz_default.asset; the version on the first line.

Multiple versions of Unity

On a Mac, simply change name of Unity directory in /Applications/....

Naming convention suggestion: Unity X.Y.Z[fp]W (f = official release and p = patch release).

Example: Unity 2017.3.1f1

Download previous versions here: Unity download archive

Once installed, create alias of Unity.app, and move this to the macOS dock.

Blender/Unity Asset Organization

Optimal directory structure

•
├── Gizmos
├── Main
│   ├── Animations
│   ├── Audio
│   ├── GUI
│   ├── Materials
│   ├── Models
│   ├── Plugins
│   ├── Prefabs
│   ├── Resources
│   ├── Scripts
│   ├── Shaders
│   ├── Terrain
│   ├── Textures
│   └── Utilities
├── Sandbox
├── Scenes
├── Standard Assets
└── StreamingAssets

Other ways of doing it

Save your .blend into Sources/ folder so you can quickly edit it from Unity (via double clicking). These files are not used for any other reason; they’re just there for quick access as you’re developing.

Exporting (.fbx) is better because the file size is a lot smaller. Put these in your Prefabs/ folder (you could also call this folder “Exports”).

Overall, your folder structure looks like:

Assets/
    Buildings/
        Sources/
            House.blend
            Church.blend
        Prefabs/
            House.fbx
            Church.fbx

Blender vs Unity scale

Blender’s default cube is 2x larger than Unity:

Possible solutions: Scale down the blender cube by .5. Or, change dimensions of the Blender cube to 1x1x1.

Blender grid size

You can set Blender’s grid size to be .5, which will match Unity’s default unit size:

This is set via the properties panel (N key).

Tip: Use SHIFT when dragging to snap at smaller increments.

Blender and Unity 3D axis

Unity is Z-forward & Y-up. This is useful to know when exporting FBX from Blender:

Blender is Z up, Unity is Y up. This is the nature of the beast for ANY set of 3D programs, some choose Y, some Z, some offer both as "options".

Max is Z up. Maya is Y up but you can switch it. Blender is Z up. Softimage is Y up. C4D is Y up. Lightwave is Y up. Most CAD software is Z up.

Z and Y Axis

Unity’s character controller

Import the “Characters” package:

The default character size is 1w x 1.8h x 1d (Unity units).

Knowing about this scale will help you to understand scale in Blender for things like doorways or cieling heights.

General rule of thumb measurements

  • Door length: 2.5 units
  • Door height: 3 units
  • Window length: 5 units
  • Window height: 3 units
  • Height from floor to roof: 5 units
  • Wall width: 1 unit (should be as wide as character)

It’s a good idea to work with whole numbers when dealing with the Blender to Unity conversion. For example, the distance the window sill is from floor is 1 unit; this make it easy to calculate the overall height of the window as it relates to the overall height of the building (from floor to ceiling).

Blender Mesh Colliders Prep

Create simpler mesh collider geometry in Blender. For example, flat planes for stairs:

… Make sure to separate this mesh from the main stair model.

In Unity, enable colliders for the mesh and then turn off the “Mesh Renderer" for the ramps.

Colors

If you name your materials the same, then Unity will use those shared names. This is optimal as that allows Unity to not have a bunch of materials.

Alternatively, separating meshes and adding color materials in Unity is another approach to an optimized Unity workflow.

Clone this wiki locally