Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

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
[About macOS Ventura 13.0] (12/20/2022)
The currently released Live2D Cubism SDK is not guaranteed to work with macOS Ventura.
Please refrain from upgrading the macOS as they may not work properly.
The Cubism Editor license file may be lost after the macOS upgrade.
Please make sure to deactivate the Cubism Editor license before upgrading the macOS.
For more details
[NOTICE]
About the support for Mac models
Cubism Editor is not supported with Apple M1 processors.
Please refer to System Requirements for details.
We will not respond to any related inquiries with this message.

《Solved》 I put script for apply motion, yet still can not apply motion. help please :)

edited August 2015 in Archive
i use this script of simple.cs and place it in script folder, but still cant apply motion in unity , could you help me please? :)
i also upload my work here

------------------------------------------------------------------------------------

here the simple.cs script:

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

[ExecuteInEditMode]
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 ()
{
Live2D.init();

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); // creates a new instance for motion control class
}


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

if ( ! Application.isPlaying)
{
live2DModel.update();
live2DModel.draw();
return;
}

if (motionMgr.isFinished())
{
// Starts running a motion (unless the motion hasn’t finished playback)
motionMgr.startMotion(motion);
}

motionMgr.updateParam(live2DModel); // Feed back parameter updated by a motion to model

live2DModel.update();
live2DModel.draw();
}
}



Comments

Sign In or Register to comment.