Zoom In and Out camera[ binocular effect ] in Unity

Advertisemen

In this short unity tutorial, I am going to show you guys, how to zoom In and Out camera like in binocular in Unity3D.

First of all, create two GUITextures [GameObject > Create GameObject > GUITexture], name them ZoomIn and ZoomOut  or your preferred names and position them wherever you want, you can also change image if you want (by default it has Unity watermark image). Why GUITexture? coz it sticks with camera while we are zooming in and out.

Ok, now create two C# scripts with names ZoomInCamera and ZoomOutCamera or pick any name you want and attached them with GUITextures we have just created accordingly. And type following in these scripts.

ZoomInCamera script -



ZoomOutCamera script -

That's all you need to do, pretty simple.

Advertisemen

Disclaimer: Gambar, artikel ataupun video yang ada di web ini terkadang berasal dari berbagai sumber media lain. Hak Cipta sepenuhnya dipegang oleh sumber tersebut. Jika ada masalah terkait hal ini, Anda dapat menghubungi kami disini.

Tidak ada komentar:

Posting Komentar

© Copyright 2017 Tutorial Unity 3D