05-16-2019, 07:26 PM
(This post was last modified: 05-16-2019, 07:27 PM by electricpunch.)
(05-15-2019, 05:09 PM)_Aka_ Wrote: Just modify the ChaseCam script to keep the transform.position.y constant.
There are different ways of doing this. One could be to modify the MoveTo position to keep it's Y coordinate constant. You can also modify the Y coordinate of the interpolated position. The core idea is to override the Y coordinate at each update.
Thanks, but It did not help. I tried to fix Y position of Camera in LateUdate:
if (MoveTo)
{
if (moveHeight < 0) //init fixed camera height value
{
moveHeight = MoveTo.position.y;
}
Vector3 pos = MoveTo.position;
pos.y = moveHeight;
transform.position = Vector3.SmoothDamp(transform.position, pos, ref mVelocity, ChaseTime);
}
I think the point is that the camera is not exactly behind the player (please look at the attached screenshot), and not only the Y coordinate changes during the jump. As I see all coordinates change the value, so it's harder to solve this problem.