Helloooo
I have a camera with different iTween Paths on it
I am simply jumping back and forth by activating and deactivating them…
It’s crude, I know, but it’s actually the best solution so far…
But I want the Camara to LERP between the two paths instead of just Jumping immediately.
Here is the C# code so far:
Thanks for looking
using UnityEngine;
using System.Collections;
public class switchITween : MonoBehaviour {
Vector3 firstCam;
Vector3 secondCam;
void OnMouseUp() {
// these are a bunch of Path scripts on the main camera that I am activating and deactivating
FlythroughCameraController1 a;
FlythroughCameraControllerA b;
a=Camera.mainCamera.GetComponent<FlythroughCameraController1>();
b=Camera.mainCamera.GetComponent<FlythroughCameraControllerA>();
// float i = 0.0f;
// float rate = 1.0/Time;
// These Activate and deactivate the path scripts, but I want that camera not just to JUMP to the newly active payh but Lerp there
if (a.enabled == true) {
Debug.Log ("B");
a.enabled = false;
b.enabled = true;
// while (i>1.0) {
// i += Time.deltaTime * rate;
// Camera.main.transform.position = Vector3.Lerp(firstCam, secondCam, i);
//
// }
}
//
//
//
else if (b.enabled == true) {
Debug.Log ("A");
b.enabled = false;
a.enabled = true;
// while (i>1.0){
// i+= Time.deltaTime * rate;
// Camera.main.transform.position = Vector3.Lerp(secondCam, firstCam, i);
//
// }
}
//
}
}