Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

If you have any questions, reports, suggestions, or requests about Live2D, please send them to this community.
※We cannot guarantee statements or answers from Live2D staff. Thank you for your understanding in advance.
Live2D Cubism
Cubism Products and Downloads
Cubism product manuals and tutorials
Cubism Editor Manual    Cubism Editor Tutorial    Cubism SDK Manual    Cubism SDK Tutorial
Live2D user has created a tutorial video(unoffilcial) in English. SEE ALSO.
Thank you, brian_tsui!
[Live2D Tutorial 2020] Introduction to Tools and Technical Concepts

How to apply motions

Hi, how can i apply the motions using unity? the idle, and the other motions. how to play it in unity? Thanks :)


  • Hi makeyerrmove,

    You can see this page on how to apply motions in general.

    As for instructions specific to Unity, see below SimpleModel.cs, and in here I put English translation in parentheses next to relevant Japanese instructions.


    using UnityEngine;
    using System;
    using System.IO;
    using System.Collections;
    using live2d;

    public class SimpleModel: MonoBehaviour
    private Live2DModelUnity live2DModel;
    private Live2DMotion motion; // motion data
    private MotionQueueManager motionMgr; // モーションの再生を管理するクラス (class for running motions)

    private Matrix4x4 live2DCanvasPos;

    public TextAsset mocFile ;
    public Texture2D[] textureFiles ;
    public TextAsset motionFile; // .mtn file

    void Start ()

    live2DModel = Live2DModelUnity.loadModel(mocFile.bytes);

    for (int i = 0; i < textureFiles.Length; i++)
    live2DModel.setTexture(i, textureFiles[i]);

    float modelWidth = live2DModel.getCanvasWidth();
    live2DCanvasPos = Matrix4x4.Ortho(0, modelWidth, modelWidth, 0, -50.0f, 50.0f);

    motionMgr = new MotionQueueManager(); // モーション管理クラスのインスタンスを作成
    motion = Live2DMotion.loadMotion(motionFile.bytes); // .mtnファイルからモーションの読み込み (Creates a new instance for motion control class.)

    void OnRenderObject()
    if (live2DModel == null) return;
    live2DModel.setMatrix(transform.localToWorldMatrix * live2DCanvasPos);

    if ( ! Application.isPlaying)

    if (motionMgr.isFinished())
    // モーションの再生が終わっていれば(再生中でなければ)再生を開始する (Starts running a motion (unless the motion hasn’t finished playback).)

    motionMgr.updateParam(live2DModel); // モーションによるパラメータの更新をモデルに反映(Feed back parameter updated by a motion to model.)

Sign In or Register to comment.