Hi,
I’m currently doing the car tutorial and I have a question for you.
inside the camera’s script:
function LateUpdate () {
-
// Early out if we don’t have a target*
-
if (!target)*
-
return;*
-
// Get the forward direction of the target*
_ forward = target.TransformDirection (Vector3.forward);_ -
// Get the target position*
_ targetPosition = target.position;_ -
// Place the camera distance meters behind the target*
_ transform.position = targetPosition - forward * distance;_ -
// And move the camera a bit up*
-
transform.position.y += height;*
-
// Always look at the target*
-
transform.LookAt (target);*
}
the forward and targetPosition are something like variables? because it seems to be used like they are.
also, the wantedRotationAngle, wantedHeight, currentRotationAngle, currentHeight etc. in the smooth camera script:
function LateUpdate () {
-
// Early out if we don’t have a target*
-
if (!target)*
-
return;*
-
// Calculate the current rotation angles*
_ wantedRotationAngle = target.eulerAngles.y;_
_ wantedHeight = target.position.y + height;_
_ currentRotationAngle = transform.eulerAngles.y;_
_ currentHeight = transform.position.y;_
- // Damp the rotation around the y-axis*
_ currentRotationAngle = Mathf.LerpAngle (currentRotationAngle, wantedRotationAngle, rotationDamping * Time.deltaTime);_ - // Damp the height*
_ currentHeight = Mathf.Lerp (currentHeight, wantedHeight, heightDamping * Time.deltaTime);_
I understand what is happening in the script but I’m just a little confused about what those terms actually are.