- Home /
This post has been wikified, any user with enough reputation can edit it.
Question by
WVNL · Jan 23, 2014 at 12:15 PM ·
c#itweenfieldofvieweasing
iTween ValueTo FieldOfView isn't easing
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
}
}
Comment
Your answer
Follow this Question
Related Questions
iTween, I need a Sharp movement between points on an iTween path 0 Answers
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Using iTween to move a gameobject from node to node 1 Answer
iTween Edit Rotation Visually 0 Answers