- Home /
Isometric camera movement
Hello. I'm currently making a game similar to civilization in the block style of minecraft or creativerse. It uses an isometric camera, and I have the camera set up the way I want it, but I'm having trouble with the java script to make the camera move. I'm wanting it to be able to move forward, back, left and right on the isometric plane. My problem is this, I don't know how to limit how close and far away from the plane the camera can be. I use JavaScript. Any help?
Use Vector3.Lerp to smoothly change the camera position. Use if statements and check the xyz values of the transform.position of the camera and see if it's below or above a certain value. You can use the plane's transform.position or bounds as these values.
Answer by destructivArts · Aug 02, 2016 at 09:32 PM
You could put the movement script on an empty GameObject which is the parent of the camera. This way, local and global axis are aligned for movement, but you still have the camera pointing at the board the way you want.
Then, if you want to zoom in, just move the camera along camera.transform.forward until the camera's local y position is less than some value which you set as the max zoom in. Do the reverse for zooming out.