@@ -255,7 +255,7 @@ async function loadModel() {
255255 const selectedMotionIndex = localStorage .getItem (' selected-runtime-motion-index' )
256256
257257 // Configure the selected motion to loop
258- if (selectedMotionGroup && selectedMotionIndex ) {
258+ if (selectedMotionGroup !== null && selectedMotionIndex ) {
259259 const groupIndex = (motionManager .groups as Record <string , any >)[selectedMotionGroup ]
260260 if (groupIndex !== undefined && motionManager .motionGroups [groupIndex ]) {
261261 const motionIndex = Number .parseInt (selectedMotionIndex )
@@ -268,7 +268,7 @@ async function loadModel() {
268268 }
269269 }
270270
271- if (selectedMotionGroup && selectedMotionIndex && live2dIdleAnimationEnabled .value ) {
271+ if (selectedMotionGroup !== null && selectedMotionIndex && live2dIdleAnimationEnabled .value ) {
272272 setTimeout (() => {
273273 console .info (' Playing selected runtime motion:' , selectedMotionGroup , selectedMotionIndex )
274274 currentMotion .value = {
@@ -322,7 +322,7 @@ async function loadModel() {
322322 const selectedMotionGroup = localStorage .getItem (' selected-runtime-motion-group' )
323323 const selectedMotionIndex = localStorage .getItem (' selected-runtime-motion-index' )
324324
325- if (selectedMotionGroup && selectedMotionIndex && live2dIdleAnimationEnabled .value ) {
325+ if (selectedMotionGroup !== null && selectedMotionIndex && live2dIdleAnimationEnabled .value ) {
326326 // Restart the selected runtime motion immediately for seamless looping
327327 console .info (' Motion finished, restarting runtime motion:' , selectedMotionGroup , selectedMotionIndex )
328328 // Use requestAnimationFrame to restart on the next frame for smooth transition
0 commit comments