Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Trigger a boolean after recentering is done

Discussion in 'Cinemachine' started by MoonBeam91, Mar 10, 2023.

  1. MoonBeam91

    MoonBeam91

    Joined:
    Jan 28, 2021
    Posts:
    35
    I want to trigger a boolean after m_RecenterToTargetHeading is done.

    I am trying to implement free look , and my character currently follows the camera. I can enable the free look and make the character move independent of the camera direction. But when I disable the character instantly turns towards the camera direction.

    TLDR I want the character to follow the camera only after m_RecenterToTargetHeading is done
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,564
    You are asking, I think, about the interplay of a FreeLook camera with a character controller. I'm going to need more info about the character controller in order to say anything useful. Ideally, if you could put together a little test project with only a simple character, the character controller, and the FreeLook - just to isolate the problem to be solved - and send it to me, it would be much easier to iterate on it and get you the result you're looking for.

    As for triggering something when recentering is done, there is nothing built into CM for this. You would have to make a custom script that monitors the heading and fires an event when it's close enough to the "centered" value.