Hi All, I need infinite wisdom here! I want the camera to zoom based on the velocity but I have some issues. I have been trying to turn this script to playmaker but the mathf.clamp01 is strange. So is the moveTowards based on floats and not vector3???
if (target.rigidbody != null && cam != null) {
float spd = target.rigidbody.velocity.magnitude;
float scl = Mathf.Clamp01((spd - minZoomSpeed) / (maxZoomSpeed - minZoomSpeed));
float targetZoomFactor = Mathf.Lerp(1, maxZoomFactor, scl);
cam.ZoomFactor = Mathf.MoveTowards(cam.ZoomFactor, targetZoomFactor, 0.2f * Time.deltaTime);
}
}
Help!!!