ScreenX and ScreenY different from 0.5 aren't centering the target properly

I am trying to set up a cinemachine with a Composer aim, where the target aimed at is at the bottom left of the screen.
However, when the camera’s Y position doesn’t align with the target, the object isn’t at the defined screen target.

According to the documentation on Screen X and Y : the camera rotates so that the target appears here.

With the Screen X and Screen Y values at 0.5, it works fine

But with the Screen X and Screen Y values set be in a corner, it isn’t in the target anymore


8134451--1055441--0d2db9ff-30f0-4008-af9a-446c4fd4edd5.gif

My expected behaviour is that no matter the y position, the camera is rotated so the target is inside the dead zone.

Is there a setup, a parameter I am missing, that would ensure that no matter the camera’s Y position, the target is always inside the dead zone ?

Thank you!

Unity 2020.3.16
Cinemachine 2.6.11 and 2.8.4

1 Like

This is a known issue with the Composer when the camera pitch approaches ±90 degrees relative to world up.

I don’t know if it’s possible in the context of your application, but if you set the WorldUp Override on the CM Brain to be the same as the vcam’s local up, the problem might go away. Another possibility is to use FramingTransposer instead of Composer. That component doesn’t have this issue.

1 Like

Thank you ! Unfortunately, Camera placement is done through custom code already, so using FramingTransposer will require quite a few rework. My first test seems to agree that it goes well, but I’m afraid changing position instead of rotation will lead to the camera going to unexpected places.

For the WorldUp override, it’s a lot closer to what I’m looking for, but the Z axis rotation is sometimes too strong.

Considering I am not using dead zone, look ahead, smoothing or damping, I’m considering implementing a custom Aim script that would be close to hard look at, except with a screen offset.

Although I’m pretty sure this is more complicated than it sounds.

Not clear to me why you are getting Z axis rotation.
Your custom HardLookAt with offset might work. You might also try a plain HardLookAt with a Recomposer extension to apply pan and tilt.

1 Like