Search Unity

Positions

Discussion in 'Scripting' started by tricks21, May 1, 2008.

  1. tricks21

    tricks21

    Joined:
    Oct 29, 2007
    Posts:
    13
    Hi all, just a quick one. I was wondering if I could set a permeant position for a camera on the y axis. I still want the camera to move on the other axis but keep a set position on the y. Not sure if I can do this or how I would go about doing. Thanks for the help
     
  2. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    Try this:

    Code (csharp):
    1. var height = 0.0;
    2.  
    3. function Update ()
    4. {
    5.      transform.position.y = height;
    6. }