Cinemachine Target Group
Use Cinemachine Target Group to treat multiple GameObjects as a single Tracking target. It can also be used as targets for procedural behaviour that needs to know the size of the target, for example the Group Framing extension.
To create a Target Group:
- Add a CinemachineTargetGroup component to an empty GameObject.
To create a CinemachineCamera with a Target Group:
- In the Unity menu, choose GameObject > Cinemachine > Target Group Camera.
Unity adds a new CinemachineCamera and Target Group to the Scene. The Follow and Look At targets in the CinemachineCamera refer to the new Target Group.
To convert an existing CinemachineCamera target to a target group:
- Select Convert to TargetGroup from the popup menu to the right of the Tracking Target field in the CinemachineCamera inspector
To Populate a Target Group:
- In the Hierarchy, select the new Target Group object.
- In the Inspector, click the + sign to add a new item to the group.
- In the new item, assign a GameObject (you can drag and drop from the Hierarchy), and edit the Weight and Radius properties.
- To add more GameObjects to the Target Group, repeat steps 2-3.
Properties:
Property: | Function: | |
---|---|---|
Position Mode | How to calculate the position of the Target Group. | |
Group Center | Use the center of the axis-aligned bounding box that contains all items of the Target Group. | |
Group Average | Use the weighted average of the positions of the items in the Target Group. | |
Rotation Mode | How to calculate the rotation of the Target Group. | |
Manual | Use the values specified in the Rotation properties of the Target Group’s transform. | |
Group Average | Weighted average of the orientation of the items in the Target Group. | |
Update Method | When to update the transform of the Target Group. | |
Update | Update in the normal MonoBehaviour Update() method. | |
Fixed Update | Updated in sync with the Physics module, in FixedUpdate(). | |
Late Update | Updated in MonoBehaviour LateUpdate() . |
|
Targets | The list of target GameObjects. | |
Weight | How much weight to give the item when averaging. This cannot be negative. | |
Radius | The radius of the item, used for calculating the bounding box. This cannot be negative. |