Wordpress embed problem - nothing happens on click
Hi, I’m trying to embed a Rive animation on a Wordpress page. I have been able to get the animation to load, and the state machine is playing. The animation has a click functionality that works great in Rive editor. But nothing happens when I click on the animation on the web page. I’m not a developer, so not sure how to determine where the problem is, Rive or Wordpress?
I have this code in the header:
<script src="https://unpkg.com/@rive-app/webgl2@latest"></script>
And this code in a Custom HTML block:
<canvas id="canvas" width="600" height="300"></canvas>
<script src="https://unpkg.com/@rive-app/canvas"></script>
<script>
const r = new rive.Rive({
src: "https://muy.mystagingwebsite.com/wp-content/uploads/muyv2.riv",
canvas: document.getElementById("canvas"),
autoplay: true,
//artboard: "Artboard", // Optional. If not supplied the default is selected
stateMachines: "mhz",
onLoad: () => {
// Ensure the drawing surface matches the canvas size and device pixel ratio
//r.resizeDrawingSurfaceToCanvas();
},
});
</script>
Let me know if anyone has any advice? Thank you