How to turn off animation autostart with new gltf loader options?

Hello, like the title says, how do I turn off animation autostart with new gltf loader options? I used to be able to do it with

    SceneLoader.OnPluginActivatedObservable.add(loader => {
      if (loader.name === 'gltf') {
        // eslint-disable-next-line @typescript-eslint/no-explicit-any
        (loader as any).animationStartMode = 0; // GLTFLoaderAnimationStartMode.NONE
      }
    });

But with loader options now, I’m doing this (image) but it doesn’t seem to work at all… Please help me with this

Hey!

Did you try simply to set animationGroupLoadingMode to SceneLoaderAnimationGroupLoadingMode.Stop (1)? No loader options needed.

However if you want to use the loader plugin options you have to do it this way:

await BABYLON.importAnimationsAsync("whatever.glb", scene, {
    pluginOptions: {
        gltf: {
            animationStartMode: BABYLON.GLTFLoaderAnimationStartMode.NONE // your mode
        }
    }
})
3 Likes

that fixes it, thank you!

1 Like