Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

To Cinemachine ?

Discussion in 'Cinemachine' started by usernameHed, Apr 2, 2019.

  1. usernameHed

    usernameHed

    Joined:
    Apr 5, 2016
    Posts:
    93
    Hello, here I have a functionnal CCC, with a 3D camera who follow an object with a mario galaxy style:


    I have done that wiht custom script movement / rotation toward planet + toward player. My Camera first follow the purple point (wich rotate with the player)

    I would like to know how can I do that with cinemachine.

    When i create a simple Cinemachine virtual camera, with an body/aim. IT follow, ok:

    But I need to tell my CM camera to rotate with the current player up direction. How can I do that ?

    I know I could set Aim to "Nothing", and do my own rotation. But I would like to use Cinemachine, and I would like to know how can I aim at something with a predefined up vector (predifined with a transform, or vector3 wathever)

    Thanks !
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    Try putting your player object in the Brain's world up override:

    upload_2019-4-3_14-29-33.png
     
  3. usernameHed

    usernameHed

    Joined:
    Apr 5, 2016
    Posts:
    93
    Oh thanks ! But If I want to have multiple Cinemachine virtual camera with multiple different World up Angle, I have to change this transform each time the virtual camera change ?

    Thanks
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    I depends on the vcam type. Simple vcams with Transposers having LockToTarget binding modes will take their up vectors from the target orientation. That might be enough for you, otherwise yes you'll have to set the worldUp override in the brain.
     
  5. usernameHed

    usernameHed

    Joined:
    Apr 5, 2016
    Posts:
    93
    Thanks you to your reply ! If It is possible, I suggest to add that information for each camera. I am currently having a simple script with a Quaternion variable on each Virtual Camera, and when I am changing a vitual Camera, I am updating the main WorldUp transform with the quaternion of my script attached. It's works well, but it could be done in your script.

    Thanks again, have a nice week
     
    Gregoryl likes this.
  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    Thanks for the suggestion!