Skip to content

PivotControls does not stop CameraControls from moving the camera #2408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sharky98 opened this issue Apr 5, 2025 · 2 comments
Open

PivotControls does not stop CameraControls from moving the camera #2408

sharky98 opened this issue Apr 5, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@sharky98
Copy link

sharky98 commented Apr 5, 2025

  • three version: 0.174.0
  • @react-three/fiber version: 9.1.0
  • @react-three/drei version: 10.0.4
  • node version: v22.14.0
  • pnpm version: 10.6.3

Problem description:

When using PivotControls with OrbitControls, the orbit control are "deactivated" when dragging the pivot controls. However, when using CameraControls, the camera is rotating as we move the pivot controls.

Relevant code:

https://codesandbox.io/p/sandbox/cameracontrols-basic-forked-dgglkz

Suggested solution:

@sharky98 sharky98 added the bug Something isn't working label Apr 5, 2025
@Koraus
Copy link

Koraus commented Apr 6, 2025

Hi, if you add the makeDefault prop to CameraControls, will that solve your problem?

@sharky98
Copy link
Author

sharky98 commented Apr 6, 2025

I've updated the code sandbox and it is working. But I've just realized that this is under React 18, while I'm using React 19. I've also updated the code sandbox to represent the same version I am using. And it is working. So there is something else going on... I'll circle back.

EDIT: On my local machine, when doing the same thing (although with a bit more complexity due to monorepo), I get a looping error as below.

@react-three_drei.js?v=4b80e206:96677 Uncaught TypeError: Cannot read properties of undefined (reading 'copy')
    at Object.current (@react-three_drei.js?v=4b80e206:96677:27)
    at update (chunk-PCQ3P4OM.js?v=4b80e206:13686:22)
    at loop (chunk-PCQ3P4OM.js?v=4b80e206:13707:17)
(anonymous) @ @react-three_drei.js?v=4b80e206:96677
update @ chunk-PCQ3P4OM.js?v=4b80e206:13686
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13707
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698
requestAnimationFrame
loop @ chunk-PCQ3P4OM.js?v=4b80e206:13698

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants