Overriding OrbitControls functionality

Hi,

I need some custom functionality for the OrbitControls functionality. I assumed I can just copy that file (since it’s an example) and use that + modify it. However Im getting errors:

What would be a good way to avoid this?

In general it would seem to me that examples should be useable independent of the distribution, but that doesn’t seem to be the case for this example.

In case of all examples you should be able to just copy the file and use it directly - but the important part to remember is to copy the example version that matches your three.js version:

Examples get updated together with the library (see this commit from not-that-long ago), so there’s a chance you’re using a three.js version that did not have Controls in core - but imported it as:

import { Controls } from './Controls.js';
2 Likes