FANDOM


Characters can use Unity's Anima2D asset if they rely on AC's Sprite Unity Complex animation engine, and have the following hierarchy:

  • <Root object>
  • --- <Sprite child>
  • --- --- <Anima2D Sprite Mesh tree>
  • --- --- <Anima2D Rig tree>

However, an extra script is necessary to have them work with AC's Sorting Maps, as Anima2D relies on its own Renderer to draw its sprites.

Attach a FollowSortingMap component as normal, and then add a "blank" SpriteMeshRenderer component that has no sprite, but will be updated by the FollowSortingMap component at runtime. Then attach the following script and assign the fields. This script will transfer the SpriteMeshRenderer's Sorting Order and Order In Layer fields into the Anima2D SpriteMeshInstance.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Anima2D;

public class CopySpriteOrder : MonoBehaviour
{

[SerializeField] private SpriteMeshInstance spriteMeshInstanceToUpdate;
[SerializeField] private SpriteRenderer spriteRendererToCopy;

void Update ()
{
spriteMeshInstanceToUpdate.sortingLayerName = spriteRendererToCopy.sortingLayerName;
spriteMeshInstanceToUpdate.sortingOrder = spriteRendererToCopy.sortingOrder;
}

}

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.