Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Look At issue

Discussion in 'Cinemachine' started by indoflaven, Jun 16, 2022.

  1. indoflaven

    indoflaven

    Joined:
    Sep 27, 2017
    Posts:
    5
    Here's my setup:
    • Player with child Camera (With CMBrain) and child CM virtual cam
    When I hit play the virtual cam does not have a Look At target, but through the course of play, I want to set one (for example the player looks at an object).

    As soon as I set the Look At target the Camera whips to some rotation seemingly unrelated to the Look At target before then transitioning to the correct rotation. This only seems to happen when transitioning between a Null Look At target to a Transform... but it doesn't always happen. For example, if after transitioning to a Look At target you change to null and then to other Look At target nearby, everything works fine. I've messing around with many of the option, but have not found out a way to fix this.

    If you look at the attached screenshots, you'll see what I mean. Why, after changing the Look At target to "Arch_Door" does the camera swing over to the right before transitioning to looking at the targeted transform?

    Thanks,
    -Mike

    Screenshot 2022-06-16 130915.png
    Screenshot 2022-06-16 131352.png Screenshot 2022-06-16 131420.png Screenshot 2022-06-16 131448.png
     
  2. gaborkb

    gaborkb

    Unity Technologies

    Joined:
    Nov 7, 2019
    Posts:
    856
    Your current setup is not recommended and may cause issues. Instead, unparent your Camera with CmBrain and Virtual Cameras, so the player is not their parents.
    Then assign Player to your Follow target and set Hard Lock To Target in Body. This will achieve the same positional movement as your above solution without potentially causing issues.

    Do you have the issue after doing the above?
     
    Gregoryl likes this.
  3. indoflaven

    indoflaven

    Joined:
    Sep 27, 2017
    Posts:
    5
    Extremely helpful, thank you!
     
    gaborkb likes this.