MagicaCloth can also be used in 2D games.
Here we will explain how to use it with Unity’s standard 2DAnimation.
Although only 2DAnimation is officially supported, it is likely that other 2D systems can be used with similar settings.
Change update mode
First you need to change the MagicaCloth simulation update location.
Normally it is updated after LateUpdate, but when using 2DAnimation, you need to change this before LateUpdate.
This is because the shape change of 2DAnimation is done in LateUpdate.
See Lifecycle for information on Unity’s event execution order.
Preparation is complete by changing UpdateLocation to “Before Late Update“.
Once you are ready, you can use MagicaCloth in the same way as 3D.
There are no special settings for 2DAnimation.
The following video is an example of applying BoneCloth to the head of a 2DAnimation monster.
When using BoneCloth with 2DAnimation, the final direction of each Transform is very important.
This is called RotationControl and can be changed in the following part of the inspector.
By default, the parent-child relationship is checked and the angle is adjusted to the average angle.
In 2DAnimation, this value must be set appropriately according to the influence weight of each bone.
See RotationControl for more information.
Reversing the character
When using MagicaCloth in a 2D system, you need to be careful about reversing the character.
There are usually two ways to flip a 2D character.
(1) Rotate the character’s orientation 180 degrees
(2) Set the character’s scale to negative and invert it
Please note that method (2) cannot be used because MagicaCloth does not support negative scale.
If you want to flip the character, you need to use the 180 degree rotation method in (1).