Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public GameObject lookAt;
- private bool smooth = true;
- private float smoothSpeed = 0.07f;
- private Vector3 offset = new Vector3 (0f, 3.5f, -6.5f);
- void FixedUpdate()
- {
- // THIS LINE CAUSES THE ERROR.
- Vector3 desiredPosition = lookAt.transform.position + offset;
- if(smooth)
- {
- transform.position = Vector3.Lerp(transform.position, desiredPosition, smoothSpeed);
- }
- else
- {
- transform.position = desiredPosition;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement