Rich-Harris / svelte-cubed

Svelte ❤️ Three
svelte-cubed.vercel.app
MIT License
1.19k stars 76 forks source link

[BUG] Animation component tries to set weight on undefined #46

Open AlexWarnes opened 2 years ago

AlexWarnes commented 2 years ago

ISSUE The Animation component on a loaded GLTF immediately throws the error Cannot set properties of undefined (setting 'weight')

POTENTIAL FIX I can fix the error locally when updating Animation.svelte line 28 to check for action before assigning weight, like so:

if (action && action.weight) {
  action.weight = weight;
}

Issue REPLicated Here: Animation used in the Parrot.svelte file https://svelte.dev/repl/f5f903f2258f4a969c86287e2954ddee?version=3.45.0

I'm new to SC and Three so apologies for wasting time if this is user error!