MAB: Setup & Installation

Getting the system up and running in your project is a straightforward process.


1. Import the Scripts

Place the five core scripts into your Unity project’s Assets folder.

  • MeshAnimation.cs
  • MeshAnimator.cs
  • MeshInstancingManager.cs
  • AttachmentPoint.cs

It is highly recommended to place the AnimationBaker.cs script inside an Editor folder (e.g., Assets/Editor). This is standard Unity practice for editor tools.


2. One-Time Scene Setup

The entire system is controlled by a single manager.

  1. Create a new, empty GameObject in your scene (a good name is _Managers or _Systems).
  2. Add the MeshInstancingManager.cs script to this GameObject.
  3. Select the _Managers GameObject and look at the Inspector. You will see the Mesh Instancing Manager component. Here, you must define your global LOD distances.
    • LOD Distances: This is an array of float values that define the maximum distance for each Level of Detail. They must be sorted from nearest to farthest.
      • Element 0: 25 (Means LOD 0 is used for characters up to 25 meters away).
      • Element 1: 60 (Means LOD 1 is used for characters between 25 and 60 meters).
      • Element 2: 120 (Means LOD 2 is used for characters between 60 and 120 meters).
      • Characters beyond the last distance (120m) will be automatically culled (not rendered).

That’s it! The scene is now ready. The next step is to prepare your character models and bake their animations.