Search Unity

Character looks where the camera is looking by angle constraint

Discussion in 'Cinemachine' started by a-t-hellboy, Dec 17, 2018.

  1. a-t-hellboy

    a-t-hellboy

    Joined:
    Dec 6, 2013
    Posts:
    180
    Hey there,
    I use Free Look camera for my third person character.
    The camera rotates around a character in character idle state but there is one constraint, If it is more than certain angle character should look where camera is looking. How should I add this feature ?
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    You need to add this to your character controller. Check where the camera is looking, and compare that to where the character is looking. If the angle is large enough, rotate the character.
     
  3. a-t-hellboy

    a-t-hellboy

    Joined:
    Dec 6, 2013
    Posts:
    180
    I know but there is a problem. In Idle state camera rotates by itself I mean by input x axis on free look then if I check that angle limitation and after that rotate character, because camera look at the target on the character, camera rotates too.
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    You might need to decouple this by changing the target binding mode to World.
     
    a-t-hellboy likes this.