Hi,
Vector3 point = camera.WorldToViewportPoint(target.position + new Vector3(0,4,0));
Vector3 delta = target.position + new Vector3(0,4,0) - camera.ViewportToWorldPoint(new Vector3(0.5f, 0.5f, point.z));
Vector3 destination = transform.position + delta;
transform.position = Vector3.SmoothDamp(transform.position, destination, ref velocity, dampTime);
I had some problem with this script. When the speed of the Player is higher than the camera's speed, then there is a bad effect. Is like the camera tremble up and down at high speed. How can i solve it? please answer me, and thank you :)
↧