Jump to content
Search Community

I can only Tween one Variable?

Rabies test
Moderator Tag

Recommended Posts

I'm trying to tween multiple variables that are all in "root" but the only one that actually works is always the last one, even with "overwrite" enabled:

 

TweenLite.to(this, 3,{Wind:100, delay:flakeSpeed+4, onUpdate:updateText, ease:Linear.easeNone, overwrite:1});
TweenLite.to(this, 4,{flakeSpread:300, delay:flakeSpeed+4, onUpdate:updateText, ease:Linear.easeNone, overwrite:1});
TweenLite.to(this, 5,{flakeInterval:0.2, delay:flakeSpeed+4, onUpdate:updateText, ease:Linear.easeNone, overwrite:1});
TweenLite.to(this, 5,{flakeCount:1, delay:flakeSpeed+4, onUpdate:updateText, ease:Linear.easeNone, overwrite:1});

 

In the above example, only "flakeCount" Tweens. The ones above it are ignored. If I comment out the last line, then "flakeInterval" tweens, and so forth.

 

*** I partially answered my own question (epiphany while typing here):

 

TweenLite.to(this, 5,{Wind:100, flakeSpread:300, flakeInterval:0.2, flakeCount:1, flakeSpeed:5, flakeSpeedVariance:3, delay:flakeSpeed+4, onUpdate:updateText, ease:Linear.easeNone, overwrite:1});

 

*BUT* using that method, all variables are tied to the same duration, delay, etc. How do I tween multiple variables that require different parameters??

Link to comment
Share on other sites

You set overwrite:1 on all your tweens - that means you're telling TweenLite to overwrite all existing tweens of the same target object. It was following your instructions :) I think you meant overwrite:0 or overwrite:false, right? That should solve the problem for you. Just be very careful about setting overwrite:false because it can be a bad habit to get into since it leaves you wide open to creating conflicting tweens. If you can afford the extra 1kb, I'd definitely recommend kicking on AUTO mode so that you allow TweenLite to intelligently analyze each tween and only overwrite individual overlapping properties when necessary. It's really easy to turn on AUTO mode:

 

OverwriteManager.init(2);

 

That's it. From that point on, all tweens will use AUTO overwriting by default.

Link to comment
Share on other sites

I don't normally throw in overwrite, that was there just out of frustration that the vars weren't tweening. And I guess I misunderstood its use by setting it to true rather than false.

 

That solves it though! Overwrite should be true!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...