Search Unity

  1. Unity 2019.4 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  3. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Information about cinemachine free lock camera

Discussion in 'Cinemachine' started by pappalardodd, Jun 22, 2020.

  1. pappalardodd

    pappalardodd

    Joined:
    Apr 13, 2020
    Posts:
    64
    Hi everyone, sorry for the stupid question but I'm not practical. Usually I create the settings of my camera from scratch, but in need of functions that I have seen there are in the cinemachine I decided to try to use a free lock camera for the first time.
    After setting up the camera as I wanted, I noticed that I could not add the scripts to the cinemachine in a normal way (as usually happens on the main camera by default).
    An example, I wanted the rotation on the X axis of the camera to be the same as of the Y of another object, I already had the script I used on a normal camera but when I inserted it it had no effect on the cinemachine, which rotates on that axis with the "Mouse X" input.
    How can you change the operation of the cinemachine via script?
    I think it's possible otherwise I don't explain how it is possible to add targeting functions to a game with this camera etc.
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    3,805
    Yes, the FreeLook will position itself according the the values of its X and Y input axes. By default, those are mapped to Mouse X and Mouse Y, but you can change that and control it any way you like.

    Set the "Input Axis Name" fields to blank, then add a custom script to manipulate FreeLook.m_XAxis.Value and FreeLook.m_YAxis.Value (try changing these in the inspector to see what they do).
     
    pappalardodd likes this.
  3. pappalardodd

    pappalardodd

    Joined:
    Apr 13, 2020
    Posts:
    64
    So I just put the name of the empty inputs and indicate with a script the X axis with FreeLook.m_XAxis and the Y axis with FreeLook.m_YAxis .. and attach it to the free camera? ... no need to access the parameters of the free lock camera with other calls?
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    3,805
    yes, that is correct
     
unityunity