Looking at the part of the code to zoom in/out, I've seen in other parts of these tutorials that we are using both smoothDamp and Lerp interpolations at the same time. I mean, this is the actual code: if ( currentAimRatio == 1) // We are not aiming at enemy { zoomRatio = Mathf.SmoothDamp ( zoomRatio, 1, zoomRatioV, ZoomSpeedRatio); } else { zoomRatio = Mathf.SmoothDamp ( zoomRatio, 0, zoomRatioV, ZoomSpeedRatio); } camera.fieldOfView = Mathf.Lerp ( aimingCameraZoom, defaultCameraZoom, zoomRatio ); I'd tried this one with very similar result apparently : if ( currentAimRatio == 1) // We are not aiming at enemy { camera.fieldOfView = Mathf.SmoothDamp ( camera.fieldOfView, defaultCameraZoom, zoomRatioV, ZoomSpeedRatio); } else { camera.fieldOfView = Mathf.SmoothDamp ( camera.fieldOfView, aimingCameraZoom, zoomRatioV, ZoomSpeedRatio); } Thanks in advance.
I suppose i probably could've done it like that. I think it's a bit of habit for me. I've had problems in the past with transforms, and what i found was that things seemed to work more efficiently when outside variables are only manipulated once. So I was trying to figure out what camera.fieldOfView had to be and then change it to that only once per frame, as opposed to manipulating it directly. With unity3.5 though, it might not be a problem anymore. Unity3.5 seems to have fixed a lot of issues like this and generally makes everything run better and the way you'd expect it to.
Hi eteeski I am following your fps tutorials as well and I would like to know if there is anyway to optimize the ai scripts to work for map switching and multiplayer thank you for your awesome tutorials.