We currently have 2 movement types we switch between. One is an OrbitController derived from the OrbitControls movement by ThreeJS. The other is a self-written FirstPersonController. We switch between the 2 by a dropdown menu.
But currently, I’m walking into a problem where we still have a target in the camera, and we can’t remove it entirely so that we can use our other FirstPersonController movement logic.
Use the OrbitControls.
Set that bool to false.
Enable another movement controller.
Then you’ll see that the camera still has a target and makes it so we can’t use that new movement controller properly.
Scene.instance.cameraController.orbitController.orbitControls.enabled = false;
Scene.instance.cameraController.orbitController.orbitControls.target = null; // This isn't possible to do, but is where we think the problem rises.
Scene.instance.cameraController.orbitController.orbitControls.target0 = null; // This isn't possible to do, but is where we think the problem rises.
There isn’t one, currently in a closed Development space.
Here you can see we’re able to use the orbit controls. But as soon as we switch, we can only still zoom to a certain target but aren’t able to look around with the camera:
This is how the FirstPersonController should act without any targets to look at:
I’m afraid I won’t be able to make an example, it takes too much time to do so, and this isn’t permitted by my boss to work on. As our current project is done in Vue and Typescript and it would take too much time to convert. So I’ll have to find a solution myself, thanks tho!
Yeah, I have. It also seems that the eventListeners are still working, which should also be disabled. But in that case, we would need to call dispose() and don’t have a way to add those even listeners again when we switch back to the OrbitControls.