x


[iTween] tweening the range variable of MouseOrbit on a camera

Hi,

I was wondering how i can properly tween a value on an object.

I have an MouseOrbit script attached to a camera and i would really like to tween the range value. I have noticed the valueTo method on iTween but not sure how to call it properly.

The code below however, doesn't appear to work because a) trying to cast a camera with an gameobject is required and b) i can't seem to access distance this way.

Camera cam = Camera.allCameras[0];
    ht = new Hashtable();
    ht.Add("from", cam.GetComponent(MouseOrbit).distance);
    ht.Add("to", range);
    ht.Add("time", 1);
    iTween.ValueTo(cam, ht);
more ▼

asked Aug 23 '10 at 07:18 PM

Kevin 3 gravatar image

Kevin 3
1 1 1 3

Issue resolved. Pays off to RTFM :D

Aug 23 '10 at 08:45 PM Kevin 3

Post your solution, please. If you had the question, chances are someone else will too. You can even mark it as the correct answer.

Aug 24 '10 at 10:56 AM Bampf

plz do tell us :)

Sep 05 '10 at 01:27 AM vyruz

please share! thanx.

Nov 05 '10 at 11:39 AM headkitgames
(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x426
x30
x17
x6

asked: Aug 23 '10 at 07:18 PM

Seen: 901 times

Last Updated: Aug 23 '10 at 08:05 PM