General Category > EasyTouch

How to Zoom Camera Field Of View in and out (FIXED) - Now Pan & Tilt freeze on Z


How to Zoom Camera Field Of View in and out with Pinch in and out?

Hey all. I have not used this Unity asset in quite some time. I was wondering how I would zoom-in and zoom-out on the MainCamera in a Scene using Field Of View and this package.

Any ideas? Any code laying round you could share?

I am trying to make the zoom-in and zoom-out on pinch in and out as smooth as possible as well.

Thanks for any insights you all have for me.

Also, how can we clamp z-axis on the Camera? I do not want that to rotate. It throws the view way off and will confuse some customers. They will not be able to fix the view.

Any ideas? Anyone?

Unfortunate I have not seen a response to my first question yet.

Related to pan and tilt of the Main Camera.

I did some experimenting with putting some code in this company's ETCTouchPad.cs file.

So far I have the following. It's a bit choppy. I'll have to see what I can come up with to smooth it down more.

// Keeps the Main Camera from rotating at odd angles on the z-axis
--- Code: --- Camera.main.transform.localEulerAngles = new Vector3(Camera.main.transform.localEulerAngles.x, Camera.main.transform.localEulerAngles.y, 0f);
--- End code ---

I fist tried this in the OnDrag() method. Really jumping.

Now I am experimenting with it at the bottom of the UpdateTouchPad() method in the same class.

Any suggestions you all have would be appreciated if you have run into this need before. Otherwise I hopes this helps someone else.

Thank you.

Ps. Developer(s). It would be nice to have individual x,y,z axis clamping ability (plus the other clamp option is not working for me. I remember it use too).


[0] Message Index

Go to full version