Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. We're looking for your feedback on the platforms you use and how you use them. Let us know!
    Dismiss Notice
  4. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  6. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  7. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  8. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Can't access Cinemachine via c#

Discussion in 'Cinemachine' started by grossim, Apr 7, 2018.

  1. grossim

    grossim

    Joined:
    Mar 15, 2013
    Posts:
    32
    Hello,
    as per title, i am trying to access the cinemachine virtual camera script parameters via a custom c#.

    There is no mention on how to do that on cinemachine documentation.

    Any idea?

    Thanks!
     
  2. grossim

    grossim

    Joined:
    Mar 15, 2013
    Posts:
    32
    Edit:

    I figured it out.

    - add
    using.Cinemachine
    on top of the script.
    - refer to the cinemachine camera using
    public CinemachineVirtualCamera vcam
    ;

    you can now access all the parameters:
    upload_2018-4-8_0-8-9.png

    Remember the cinemachine virtual camera might update on a different Update method ("Smart", fixed, late), so make sure to add all your per-frame calculations in the right one, or you won't get the behaviour you expect. (you can check and specify the update method used by the virtual camera clicking on the virtual camera gameobject).

    Hope this will help.
     

    Attached Files:

  3. Adam_Myhill

    Adam_Myhill

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    302
  4. grossim

    grossim

    Joined:
    Mar 15, 2013
    Posts:
    32
  5. Chregu

    Chregu

    Joined:
    Jan 7, 2018
    Posts:
    1
    Hi everyone
    I have a problem that visual studio won't find the Cinemachine Namespace (CS0246) eventhough I installed cinemachine into my project... it once worked but now it won't find the namespace anymore.
    Funnily enough on the unity side of things everything works normally, meaning that if i ignore the errors it works correctly in unity.

    Any ideas why this is happening?
     
  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,408
    Try updating your Visual Studio Tools for Unity