# Just need .glb animation doesn't restart when i lost image target

**URL:** <https://forum.8thwall.com/t/just-need-glb-animation-doesnt-restart-when-i-lost-image-target/7235>\
**Category:** Technical Support\
**Tags:** image-targets\
**Created:** [June 23, 2025, 11:48pm UTC](https://forum.8thwall.com/t/just-need-glb-animation-doesnt-restart-when-i-lost-image-target/7235 "2025-06-23T23:48:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Isai\_Rascon](https://avatars.discourse-cdn.com/v4/letter/i/848f3c/32.png) [@Isai\_Rascon](https://forum.8thwall.com/u/Isai_Rascon)\
**Post date:** [June 23, 2025, 11:48pm UTC](https://forum.8thwall.com/t/just-need-glb-animation-doesnt-restart-when-i-lost-image-target/7235/1 "2025-06-23T23:48:55Z")

</div>

My GLB model restarts when image target is lost and that causes the audio to become out of sync. I really need solution I know just basics of programming. is all I need.. I got audio sync with image target thanks George for that!!! but just I need Animations Keeps at time once if found image target again

import \* as ecs from ‘[@8thwall](https://forum.8thwall.com/groups/8thwall)/ecs’

ecs.registerComponent({  
name: ‘PlayGLBClipOnImageFound’,  
schema: {  
model: ecs.eid, // Nodo del modelo GLB  
clipName: ecs.string // Nombre del clip o “\*” para reproducir todos  
},

stateMachine: ({ world, eid, schemaAttribute }) =\> {  
ecs.defineState(‘default’)  
.initial()  
.listen(world.events.globalId, ‘reality.imagefound’, () =\> {  
const { model, clipName } = schemaAttribute.get(eid)

```auto
    setTimeout(() => {
      ecs.GltfModel.set(world, model, {
        animationClip: clipName || '*',
        loop: false,
        paused: false,
        time: 0,
        timeScale: 1,
        crossFadeDuration: 0
      })

      console.log(`🎬 Animación '${clipName || "*"}' reproducida con delay`)
    }, 50) // 50 ms de retardo
  })

```

}  
})

---

<div class="post-metadata">

**Author:** ![GeorgeButler](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.8thwall.com/georgebutler/32/1903_2.png) [@GeorgeButler](https://forum.8thwall.com/u/GeorgeButler)\
**Post date:** [June 24, 2025, 5:35pm UTC](https://forum.8thwall.com/t/just-need-glb-animation-doesnt-restart-when-i-lost-image-target/7235/2 "2025-06-24T17:35:52Z")

</div>

Save the `time` variable from the GltfModel component and then set the `time` variable when it’s found again. Also I would remove the `setTimeout` as that could be de-syncing things.
