Use in 2D

Introduction

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.

To change the simulation update location, use the API or place the MagicaSettings component in the scene as follows.

Preparation is complete by changing UpdateLocation to “Before Late Update“.

MagicaCloth settings

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.

Transform direction

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

Generally, there are 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

MagicaCloth supports both (1) and (2).
However, (2) requires MagicaCloth version 2.8.0 or higher.

In the next video, MagicaCloth is set up for the hair and the entire character is inverted using negative scale.
When reversing, the position, velocity, inertia, etc. are all reversed, and the characteristic is that it behaves as if the reversal had never occurred.