Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct here to familiarize yourself with the rules and how to post constructively.

  2. Unity 2022.1 is now available as the latest Tech release.
    Dismiss Notice
  3. Improve your project's performance with our new guide on profiling in Unity.
    Dismiss Notice

Assign "2d Freeform Directional" trees as a state in a state driven camera

Discussion in 'Cinemachine' started by Misscelan, Jan 12, 2022.

  1. Misscelan

    Misscelan

    Joined:
    Mar 8, 2013
    Posts:
    149
    Is it possible to assign a "2d Freeform Directional" blend tree as a state in a State Driven Camera?
    It seems I can only assign the final animations assigned to each slot of the Directional tree.

    Thanks.
     
  2. gaborkb

    gaborkb

    Unity Technologies

    Joined:
    Nov 7, 2019
    Posts:
    668
    You can assign states from a blend tree.
    Screen Shot 2022-01-13 at 9.06.09 AM.png

    See our StateDrivenCamera example scene. It uses Animator Controller - CharacterController, which has a 2D freeform blend tree.
     
  3. Misscelan

    Misscelan

    Joined:
    Mar 8, 2013
    Posts:
    149
    Hey thanks for the reply @gaborkb !

    I guess I didn't explain myself correctly, if I want to have a Camera for all the States inside a blend tree, in your example, I cannot assign a camera to "Locomotion" but I would need to assign each State separetely ("Idle", "Walk" and "Jog")?
     
  4. gaborkb

    gaborkb

    Unity Technologies

    Joined:
    Nov 7, 2019
    Posts:
    668
    Sorry, I might have misunderstood your question.

    In our example scene, Locomotion (blend tree) is assigned to CM Freelook, and Sprint is assigned to CM Freelook sprint. See the attached images. Is that what you'd like to have?

    Screen Shot 2022-01-13 at 1.41.22 PM.png
    Screen Shot 2022-01-13 at 1.41.30 PM.png Screen Shot 2022-01-13 at 1.42.17 PM.png
     
unityunity