AnyPortrait > Manual > Root Unit
You must register as a root unit to move your character into the scene.
With the Setting tab of the mesh group selected, press the Set Root Unit button to register as the root unit.
You can see that Root Unit 0 is newly registered in Hierarchy UI.
The root unit has no name and is given a index number in the order of registration.
If you want to control it in a script, you can use this number to distinguish it.
On the screen where you select the root unit you can specify (1) the animation to start automatically,
(2) cancel registration from the root unit.
It is also possible to register two or more root units.
When registering and using multiple root units, the following features are available.
- Root Unit 0 is the default and the rest is hidden.
- You can use the functions in the script to switch the root unit.
- When you execute the animation using script, it automatically switches to the root unit corresponding to the animation.
- The index of the root unit is specified in the registration order.
The root unit seems to be the same as the mesh group, and distinguishing between the two may not seem very meaningful.
From the user's perspective, the process of registering a mesh group as a root unit seems unnecessary.
The difference between the root unit and the mesh group is because the purpose and nature of data handling are different from the AnyPortrait system perspective.
1. The mesh group is the unit for editing, and the root unit is the unit for running the game.
2. Some mesh groups can be excluded from Bake by not registering them as root units.
3. A mesh group can be a child of another mesh group, but the root unit cannot.
4. Since the root unit is identified by index rather than name, it contributes to improving the performance of the internal system.