Search Unity

Smove look at controler

Discussion in 'Scripting' started by NOIG, Jul 31, 2015.

  1. NOIG

    NOIG

    Joined:
    Jul 15, 2014
    Posts:
    32
    So im trying to make a camera system where you look at an object and orbit around it and run smoothly this is my code

    Code (csharp):
    1.  
    2.     GameObject target;
    3.  
    4.     void Start(){
    5.         target = GameObject.Find("Player");
    6.     }
    7.  
    8.     void Update(){
    9.         this.transform.LookAt (target.transform.position);
    10.         transform.RotateAround (target.transform.position, new Vector3(Input.GetAxis("Mouse Y"), Input.GetAxis("Mouse X"), 0), 150 *              Time.deltaTime);
    11.     }
    12.  
    13.  
    im trying to get it to not flixer when you look some directions and to be apple to zoom in and out of the object
     
  2. NOIG

    NOIG

    Joined:
    Jul 15, 2014
    Posts:
    32
    BTW i already read ever answer and forum post about this subject and i still got nowhere, ive been working on this for 3 hours new
     
  3. NOIG

    NOIG

    Joined:
    Jul 15, 2014
    Posts:
    32
    bump