I am making a game, and I would like to be able to zoom in and out of a map and would like to know how to do that. Can anyone help, please?
Several variables here… Do you want to zoom the Camera itself or the Object? Is the map a GameObject or Sprite? Are you using an Orthographic camera or Perspective camera?
I would like the camera to zoom onto the object (which is a gameobject) and I’m currently using a perspective camera.
Likely what you’re looking for:
That doesn’t work I get a error message saying
‘NullReferenceException: Object reference not set to an instance of an object
CameraManager.Update () (at Assets/CameraManager.js:9)’
I found something that works Clamp Mouse Zoom using Scroll Wheel (SOLVED) - Questions & Answers - Unity Discussions
I’d hope that they would’ve gotten this working within the 5 years after they posted this thread.
@Vryken But remember that some people come to the thread much later, and can still use newer advice.