Hi, I’m trying to use iTween’s “ValueTo” function to smoothly expand the camera’s Field of View.
Currently it does perform the transition but there’s no easing and it’s very jerky. I’ve tried switching the easeType with no improvement. Anyone see what might be causing it? Field of View does seem to accept float values.
Thanks, code below:
using UnityEngine;
using System.Collections;
public class camView : MonoBehaviour {
Hashtable ht = new Hashtable(); // iTween table
void Awake(){
ht.Add ("from",65f);
ht.Add ("to",80f);
ht.Add("time",1f);
ht.Add("delay",3f);
ht.Add("onupdate","changeView");
}
// Use this for initialization
void Start () {
iTween.ValueTo(gameObject,ht);
}
// Update is called once per frame
void Update () {
}
void changeView(float newValue){
print(newValue);
Camera.main.fieldOfView = newValue; // update cam
}
}