How can I animate a modelviewer in my online store using JavaScript?

How can I animate a modelviewer in my online store using JavaScript?

Cheekymonkey13
Excursionist
30 1 1

Hey 🙂

I want to include a modelviewer in my Shopify store. Both using the Shopify and embedding it manually works and the model gets displayed.

However, attempting to change or animate anything has not been successful yet. When both trying to get to the object with "id" and "ref", it ends up showing this error:

Uncaught TypeError: Cannot read properties of undefined (reading 'model') at HTMLDivElement.

I followed the basic examples as in https://modelviewer.dev/examples/scenegraph/#changeColor.

If I inspect the code on the website, I see that the modelviewer has the necessary id-tag.

Thank you in advance 🙂

Replies 0 (0)