Replies: 2 comments 5 replies
-
you cant mix controls with manual cam changes, it makes no sense. controls mutate the camera every frame, so yours changes are overwritten or worse, there's a race condition. either control the camera yourself, or control it. if you need both, then you disable controls while the user is doing something - but in your case i dont think that will work. what you can do is rotate/move the objects in your scene instead of the camera. put everything into a group and shake it on mouse-move. that allows you to have both mouse effects and controls. |
Beta Was this translation helpful? Give feedback.
-
@drcmda , should it be like this: interface DomeProps { const Dome = ({ useEffect(() => {
}, []); return (
); export default Dome; |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
@drcmda , I wanted to ensure that camera moves on mouse move. So, to achieve that I am using useFrame(), that is, this code ```
function CameraMovement() {
useFrame(({ mouse, camera }) => {
camera.position.x = -mouse.x * 0.5;
camera.position.y = -mouse.y * 0.5;
});
return null;
}
Beta Was this translation helpful? Give feedback.
All reactions