How to increment Yposition value for maincamera in unity3d


(R.Pavan Kumar) #1

Hi,i have a scenario in which i want to increase y position value for main-camera in unity but it is not like script attached to main-camera something like to increment y position value for main-camera by script attached from another game-object.Could someone help me on this regard.

For increment Y position value with script attached to Main-camera object i guess to write code like this:
Debug.Log(transform.position.y);
transform.Translate(Vector3.up * 4, Space.World);

But i supposed to increment y position value for main-camera by script attached from another game-object.