From 895fb9ac0beee5fadcd19b0b7910cdbe44255a34 Mon Sep 17 00:00:00 2001 From: hobokenchicken Date: Thu, 4 Jun 2026 12:10:20 -0400 Subject: [PATCH] fix: Live2D Ticker registration + outfit texture swap path - Registered pixi Ticker via (Live2DModel as any).registerTicker() to fix 'No Ticker registered' warning and animation issues - Fixed outfit texture swap: textures live on model.textures[] not model.internalModel.textures[] --- frontend/src/components/KiraAvatar.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/KiraAvatar.tsx b/frontend/src/components/KiraAvatar.tsx index 5a814ea..cd6db08 100644 --- a/frontend/src/components/KiraAvatar.tsx +++ b/frontend/src/components/KiraAvatar.tsx @@ -48,9 +48,13 @@ export default function KiraAvatar(props: Props) { } await loadScript('/live2d/cubism/live2dcubismcore.min.js'); - const { Application } = await import('pixi.js'); + const { Application, Ticker } = await import('pixi.js'); const { Live2DModel } = await import('pixi-live2d-display/cubism4'); + // Register pixi Ticker so Live2DModel can drive animations + // Cast needed due to pixi-live2d-display expecting older Ticker type + (Live2DModel as any).registerTicker(Ticker as any); + // Responsive sizing const size = Math.min(container.clientWidth || 260, 260); const app = new Application({ @@ -173,8 +177,8 @@ export default function KiraAvatar(props: Props) { const tex = await Assets.load(outfitUrl); // Swap texture slot 2 (clothing layer) in the model's texture array. // The render loop automatically binds WebGL textures from PixiJS textures. - if ((model as any).internalModel?.textures) { - (model as any).internalModel.textures[2] = tex; + if ((model as any).textures) { + (model as any).textures[2] = tex; } else { console.warn('[Outfit] cannot swap — no textures array'); }