[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.Question - preloading motions
I wonder if there is a way to pre-load mtns.
load_motion(motion1.mtn);
...
load_motion(motion2.mtn);
...
load_motion(motion1.mtn);
function load_motion(mtn){
Figure.loadBytes(mtn, function(buf){
motion = new Live2DMotion.loadMotion(buf);
});
}
Very frequently, I load
motion1, then soon
motion2, and soon after
motion1 again.
The above code is making my game run slow on some devices. There isn't a lot of mtns. I need to interchange mtns frequently.
So I want to ask : How do I preload mtns?
PS: I tried to make an array (which would store all the motion bytes), for loop and this:
motion[i] = new Live2DMotion.loadMotion(buf); . But it doesn't work.
Thank you in advance
0 ·
Comments
Near the very beginning, just after the
.model.jsonis defined into your code:for(var i = 0; i < modelDef.motion.length; i++){ load_motion(modelDef.motion[i], i); }var init_mtn = 0; var curr_mtn = init_mtn; ... function load_motion(mtn, index){ Figure.loadBytes(mtn, function(buf){ motion = new Live2DMotion.loadMotion(buf); motion.setFadeIn(0); motion.setFadeOut(0); motion_bytes[index] = motion; if(index === modelDef.motion.length-1){ startMtn(curr_mtn); } }); }function startMtn(no){ motionMgr.startMotion(motion_bytes[no]); }And in the periodic draw function:if(motionMgr.isFinished()){ motionMgr.startMotion(motion_bytes[curr_mtn]); } motionMgr.updateParam(live2DModel);