Search Unity

Question when follow/lookat target position is far from zero, virtualcamera trackpoint has a unusual offset

Discussion in 'Cinemachine' started by xdd7777, Sep 16, 2020.

  1. xdd7777

    xdd7777

    Joined:
    Nov 16, 2015
    Posts:
    3
    HI
    I use cinemachine to create a FPS ThirdPerson camera, body use "Framing Transposer", Aim use "POV", because I want gun has sight function, so change camera distance to mindistance(0.01)
    when target pos is (-1110.6, 160, 1153.3) and I move mouse, I found the trackpoint(yellow point) has a unusual offset to Body center.

    If I change follow/lookat target position to zero, the offset isn't exist.


    I had upload a sample project as attached file "CinemachineIssue.zip"
    Any ideas? Thanks.
     

    Attached Files:

  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    The yellow dot in this case is editor-only, you will not see it in your game.

    It is unusual to have such a small target distance on the Framing Transposer, and in this circumstance the dot position is noisy when the target is far from the origin.

    Why are you using the Framing Transposer here? It's not bringing you anything. Just use a HardLockToTarget in the Body section.
     
  3. xdd7777

    xdd7777

    Joined:
    Nov 16, 2015
    Posts:
    3
    Thank you very much, you save my life.:)
     
    Gregoryl likes this.
  4. Ziqin-Qu

    Ziqin-Qu

    Joined:
    Feb 10, 2015
    Posts:
    2
    Hi, Gregoryl. I met the same issue.

    I used HardLockToTarget as you mentioned with a camera distance 1 or more, if the target position is big, say (10000,0,10000), I'll get the same result as the pic showed above. I placed a cube in front of the camera, same place as the yellow dot, it has annoying jitters if I move the camera.

    Any suggestions about this?