-
Hi, I'm trying to update my scrollbar progress whenever my camera changes its position in my scene, with no success. This example shows exactly what I'm trying to achieve: that selected an option, the camera moves updating the scrollbar progress. Unlike the example, I'm using drei's Here's the code that reproduce the problem, as you can see, when you click an option, the camera moves successfully, but the scrollbar doesn't move at all: https://codesandbox.io/s/mixing-html-and-webgl-w-occlusion-forked-zccr4t?file=/src/Setup.jsx |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
You were close! You needed to set Here is a demo with the fix. https://codesandbox.io/s/mixing-html-and-webgl-w-occlusion-forked-vr117c?file=/src/Setup.jsx |
Beta Was this translation helpful? Give feedback.
You were close!
You needed to set
page
tostate.clicked
so thatscroll.el.scrollLeft
was getting the right value.page
was hardcoded to 3.Here is a demo with the fix.
https://codesandbox.io/s/mixing-html-and-webgl-w-occlusion-forked-vr117c?file=/src/Setup.jsx