Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void pRotateAndPosition()
- {
- _TimeElapsed += (Time.deltaTime / TimeInSecondsInWhichWeWantToGetToFinalRotationAndPosition);
- if (_TimeElapsed >= TimeInSecondsInWhichWeWantToGetToFinalRotationAndPosition)
- {
- _StopCallingThisVoid = true;//don't call this anymore
- //set the final position and rotation in case we're not completely there yet
- _camera.transform.localRotation = Quaternion.Euler(goalRotation);
- _camera.transform.localPosition = goalPosition;
- return;
- }
- float fTime = _TimeElapsed;//absolutely not sure about this one
- _camera.transform.localRotation = Quaternion.Lerp(_camera.transform.localRotation, Quaternion.Euler(goalRotation), fTime);
- _camera.transform.localPosition = Vector3.Lerp(_camera.transform.localPosition, goalPosition, fTime);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement