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 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
[About Cubism Editor / SDK 5.4 Alpha](Updated: July 14, 2026)

You can download the alpha installer from the dedicated forum below.
If you have any feedback regarding the alpha version, including feature requests or bug reports, please use the same forum.

Cubism Editor / SDK 5.4 Alpha Forum
https://creatorsforum.live2d.com/c/cubismeditorsdk54alpha/

[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.

How can I change motions in the sample app project by mouse clicks?

edited December 2023 in Help
i wonder if i use sampleApp1, can i change motion by click the button that i made in unity?

for example:

button 1 = motion A
button 2 = motion B
button 3 = motion C
and i want after motion finished, motion back to iddle motion.

thank you :)
Tagged:

Comments

  • edited April 2015
    Add the following code to the end, You can change the motion by calling from UGUI button.
    [LAppModelProxy.cs]
    public void button1_click(){
    	model.StartMotion("shake", 0, 2);
    }
    
    public void button2_click(){
    	model.StartMotion("tap_body", 0, 2);
    }
    
    model.StartMotion(argument1, argument2, argument3)

    ・argument1 = model.json - GroupID("idle", "tap_body", "pinch_in", "shake"...)
    ・argument2 = model.json - GroupID - File number(0, 1, 2, from the top ...)
    ・argument3 = 2(fixed) → Priority

    Please try this.
     ↓
    Specified motion playback in SampleApp1 of Live2D
  • wooow thanks! it work! :D

    is LAppModelProxy.cs has function to stop motion (except idle motion) while playing ?
    I think it would be more fun i can control when motion of my model stop :)
  • edited May 2015
    I think you can stop the motion following code.
    [LAppModel.cs]
    public class LAppModel :L2DBaseModel
    {
        private LAppModelProxy parent;
        private LAppView view;
        public bool motion_stop = false; // add code
        .
        .
    
    
    public void Update(){
        .
        .
            live2DModel.loadParam();
        // modify code start
    	bool update = false;
    	if(motion_stop == false){
    //		bool update = mainMotionManager.updateParam(live2DModel);
    		update = mainMotionManager.updateParam(live2DModel);
    	}
        // modify code stop
            if (!update)
        .
        .
        if(motion_stop == false){  // add code
            live2DModel.update();
        }   // add code
    }
    
    [LAppModelProxy.cs]
    // add code
    public void button4_click(){
        // motion stop
        model.motion_stop = false;
    }
    public void button5_click(){
        // motion start
        model.motion_stop = true;
    }
    
  • thank you for your help, but after i followed your instruction i found this problem.

    it say:
    Assets/Scripts/sample/LAppModel.cs(197,22): error CS0136: A local variable named `update' cannot be declared in this scope because it would give a different meaning to `update', which is already used in a `parent' scope to denote something else
  • edited May 2015
    I don't know this error only.
    Do you have what code to 197 line ?
  • ah im sorry i forgot upload the screenshoot of error code
    here the code in 197 line.
    i found error code come from the code that you give

    i wonder, am i wrong write the code that you give or something?
    because i really follow your instruction correctly

    i upload code from LAppModel.cs and LAppModelProxy.cs
  • edited May 2015
    I was understand problem.
    Please look at my wrote code!

    The code in 197 line is comment out.
    //      bool update = mainMotionManager.updateParam(live2DModel);
    
  • oh my.... im sorry i am not scrupulous
    thank you a lot :D
    now my motion can stop but the audio still running.
    can audio set like motion too?
  • Answer was delayed.
    Voice stop is add the following code.
    [LAppModel.cs]
    public void Update()
    {
    	・
    	・
    	// Add code start
    	if (motion_stop == true)
    	{
    		// voice stop
    		asVoice.Stop();
    	}
    	// Add code stop
    	・
    	・
    }
    
  • it works!
    thank you naotaro, you really help me :D
Sign In or Register to comment.