Timing of Value Operations in Cubism SDK for Unity

Updated: 07/25/2019

This page is for Cubism version 4.2 or earlier. Click here for the latest version.

When manipulating the values of model parameters in Unity, it is recommended to do so at the time of MonoBehaviour.LateUpdate().

// Not recommended
private void Update()
{
    _cubismModel.Parameters[0].Value = value;

    _cubismModel.Parameters[1].BlendToValue(CubismParameterBlendMode.Additive, value);
}


// Recommended.
private void LateUpdate()
{
    _cubismModel.Parameters[0].Value = value;

    _cubismModel.Parameters[1].BlendToValue(CubismParameterBlendMode.Additive, value);
}

In the Live2D Cubism SDK for Unity, animation playback uses Unity’s built-in Animator and Playable APIs, which apply parameter values between MonoBehaviour.Update() and MonoBehaviour.LateUpdate().
Therefore, if a parameter value is set in MonoBehaviour.Update(), the value may be overwritten by the animation due to the execution order.

See the official Unity documentation for more information on Unity’s event functions.

Was this article helpful?
YesNo
Please let us know what you think about this article.