Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

feat: enhance agent thinking animation with transition effects

nirholasad1ed9cbb506
diff --git a/chat/src/App.svelte b/chat/src/App.svelte
index f63deb648..80a3be18c 100644
--- a/chat/src/App.svelte
+++ b/chat/src/App.svelte
@@ -1536,6 +1536,8 @@
let agentPendingSpeak = null;
let agentVisible = false;
let agentScriptLoaded = false;
+ let prevThoughtBubbleActive = false;
+ let thinkingTransitioning = false;
let agentPickerOpen = false;
let showAgentSettings = false;
@@ -1657,8 +1659,10 @@
}, { once: true });
}
- $: if (agentEl && agentReady && !avatarExitAnim) {
- if (generating) {
+ $: if (agentEl && agentReady && !avatarExitAnim && !thinkingTransitioning) {
+ if (thoughtBubbleActive) {
+ agentEl.play('think', { loop: true }).catch(() => {});
+ } else if (generating) {
agentEl.play('walk', { loop: true }).catch(() => {});
} else {
agentEl.play('idle', { loop: true }).catch(() => {});
@@ -1666,6 +1670,22 @@
}
}
+ // When thinking ends, play a one-shot falling animation before resuming the loop.
+ $: {
+ const wasActive = prevThoughtBubbleActive;
+ prevThoughtBubbleActive = thoughtBubbleActive;
+ if (wasActive && !thoughtBubbleActive && agentEl && agentReady && !avatarExitAnim) {
+ thinkingTransitioning = true;
+ try { agentEl.play('falling', { loop: false }); } catch {}
+ setTimeout(() => {
+ thinkingTransitioning = false;
+ if (agentEl && agentReady && !avatarExitAnim) {
+ agentEl.play(generating ? 'walk' : 'idle', { loop: true }).catch(() => {});
+ }
+ }, 1200);
+ }
+ }
+
$: if (effectiveAgentId) {
agentReady = false;
agentPendingSpeak = null;