If you have any questions, reports, suggestions, or requests about Live2D, please send them to this forum.
※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
[Regarding macOS Tahoe](Updated October 16, 2025)
macOS v26 Tahoe is now supported!
We advise against upgrading your macOS at this time as it may cause Live2D products not to function correctly.
Upgrading macOS can also cause you to lose your Cubism Editor license file.
Please make sure to deactivate your Cubism Editor license before upgrading the macOS.
For more details:
https://help.live2d.com/en/other/other_09/
For inquiries regarding issues with license purchases or license activation errors, please contact us through the email form.
https://youtu.be/w5gQhcxTmuI?t=3m21s
Comments
Try to modify the code as follows .
The modified point was put comments (Add Code) .
SampleApp1/Assets/Scripts/sample
[LAppModelProxy.cs]
public class LAppModelProxy : MonoBehaviour { public String path=""; public int sceneNo = 0; private LAppModel model; //---- Add Code start(set swip motion file) ----// public TextAsset swipingMtn; //---- Add Code end(set swip motion file) ----// private bool isVisible = false ; void Awake() { if (path == "") return; model = new LAppModel(this); LAppLive2DManager.Instance.AddModel(this); var filename = FileManager.getFilename(path); var dir = FileManager.getDirName(path); Debug.Log("Load " + dir +" filename:"+ filename); model.LoadFromStreamingAssets(dir, filename); // Add Code start(load swip motion file) ----// if(swipingMtn!=null) model.swipingMotion = Live2DMotion.loadMotion (swipingMtn.bytes); // Add Code end(load swip motion file) ----// } ・ ・set the swiping .mtn[LAppModel.cs]
・ ・ public void Init(String modelJson) { ・ ・ eyeBlink = new L2DEyeBlink(); view.SetupView( live2DModel.getCanvasWidth(), live2DModel.getCanvasHeight()); updating = false; initialized = true; } //---- Add Code start ----// bool isSwiping = false; public void setSwiping(bool b) { isSwiping = b; } // All stop Motion public void stopAllMotions() { mainMotionManager.stopAllMotions (); } public AMotion swipingMotion; int motionno=-1; //---- Add Code end ----// public void Update() { if ( ! isInitialized() || isUpdating()) { return; } view.Update(Input.acceleration); if (live2DModel == null) { if (LAppDefine.DEBUG_LOG) Debug.Log("Can not update there is no model data"); return; } if (!Application.isPlaying) { live2DModel.update(); return; } long timeMSec = UtSystem.getUserTimeMSec() - startTimeMSec; double timeSec = timeMSec / 1000.0; double t = timeSec * 2 * Math.PI;// 2πt if (mainMotionManager.isFinished()) { StartRandomMotion(LAppDefine.MOTION_GROUP_IDLE, LAppDefine.PRIORITY_IDLE); } //---- Add Code start ----// if (mainMotionManager.isFinished (motionno) && isSwiping && swipingMotion!=null) { Debug.Log ("----- SWIPING -----"); motionno = mainMotionManager.startMotion (swipingMotion); } //---- Add Code end ----// live2DModel.loadParam(); bool update = mainMotionManager.updateParam(live2DModel); ・ ・[MyGameController.cs]・ ・ void Update () { if (Input.GetMouseButtonDown(0)) { lastX = Input.mousePosition.x; lastY = Input.mousePosition.y; LAppLive2DManager.Instance.TouchesBegan(Input.mousePosition); } else if (Input.GetMouseButton(0)) { if (lastX == Input.mousePosition.x && lastY == Input.mousePosition.y) { return; } lastX = Input.mousePosition.x; lastY = Input.mousePosition.y; LAppLive2DManager.Instance.TouchesMoved(Input.mousePosition); //---- Add Code start(When no swipping) ----// GameObject.Find ("Live2D_Canvas_Haru").GetComponent<LAppModelProxy> ().GetModel ().setSwiping (true); //---- Add Code end(When no swipping) ----// } else if (Input.GetMouseButtonUp(0)) { lastX = -1; lastY = -1; LAppLive2DManager.Instance.TouchesEnded(Input.mousePosition); //---- Add Code start(When no swipping) ----// GameObject.Find ("Live2D_Canvas_Haru").GetComponent<LAppModelProxy> ().GetModel ().setSwiping (false); GameObject.Find ("Live2D_Canvas_Haru").GetComponent<LAppModelProxy> ().GetModel ().stopAllMotions (); //---- Add Code end(When no swipping) ----// }The result will be this way .Now I've noticed, it does loop the motion, but at the end of motion, it will jump back to first frame. Can I make the loop returning to specific frame instead of first frame?
I'd like to make my model keep in blushing state with eyes shut until I released my touch.
Or should I used Expressions for this? I'm thinking like... when the motion ends, I switched to display the expression mimicking last frame of the motion.
However , I don't know how to loop returning to specific frame .
It is you're right .
If your model keep in blushing state with eyes shut,
I think that it is good to use Expressions motion also together .
There is a simple Expressions use source in the past of thread .
Please be here in reference .
How do I change the model's expressions in Unity during gameplay?