combine values #1260
Unanswered
carmandale
asked this question in
Support
combine values
#1260
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a decent OnDrag working with R3F and want to also have the wheel work and influence the movement. Here is my code. This works well with drag, but I can't seem to figure out a good way, or the best way to add the wheel influence to it.
const bind = useGesture({ onDrag: ({ offset: [x, y] }) => { const aspect = viewport().factor; set({ position: [ clamp(x / aspect, -5.7, 7.0), clamp(-y / aspect, -0.1, 0.1), 3, ], }); }, onWheel: ({ offset: [, y], vxvy: [, vy] }) => { setWheel({ wheelY: y }); console.log(y); }, // { pointerEvents: true } });
Beta Was this translation helpful? Give feedback.
All reactions