Hello. I want to reset the animation playback position to 0 and play it every time the screen is tapped with the animationClip
of the Gltf model in 8thwall Studio, but the playback position isn’t changing. Could you please help me investigate the issue in the code?
import * as ecs from '@8thwall/ecs'
ecs.registerComponent({
name: 'ModelAnimation',
schema: {
animeModel: ecs.eid,
},
add: (world, component) => {
const {eid, schemaAttribute} = component
const {animeModel} = schemaAttribute.get(eid)
ecs.GltfModel.set(world, animeModel, {
url: 'assets/models/model.glb',
animationClip: 'Take 001',
time: 0,
loop: false,
paused: false,
})
world.events.addListener(
world.events.globalId,
ecs.input.SCREEN_TOUCH_START,
() => {
console.log('touch')
ecs.GltfModel.mutate(world, animeModel, (cursor) => {
cursor.time = 0
return false
})
}
)
},
})