barrowman

Simplify a lot of similar movement...

Recommended Posts

.to(root.Bokeh5, 3.70, {x:-300, ease:Sine.easeInOut, overwrite: false}, "one+=0.9")
.to(root.Bokeh4, 4.80, {x:-270, ease:Sine.easeInOut, overwrite: false}, "one+=0.7")
.to(root.Bokeh3, 6.70, {x:-290, ease:Sine.easeInOut, overwrite: false}, "one+=0.8")
.to(root.Bokeh2, 5.50, {x:-330, ease:Sine.easeInOut, overwrite: false}, "one+=0.9")
.to(root.Bokeh1, 5.20, {x:-290, ease:Sine.easeInOut, overwrite: false}, "one+=0.5")

 

This is some of my code in Animate.

 

I'm not sure whether there is a better way to do this, where I have five MCs that I want to pan across a screen at more or less the same time and speed, but not exactly. I know I could have done a Stagger but then the movement and times would have been identical and movement uniform.

 

Is it possible to do a stagger type thing that's a little less uniform?

 

Thanks in advance. 

Share this post


Link to post
Share on other sites

5 ain’t that many :)

 

Your code isn’t really decrementing or incrementing in a predictable fashion. I mean you could change defaultEase and defaultOverwrite so you don’t have to write that again OR you can use a variable for that. 

 

You could use an array for the values and then a loop but that’s total overkill and a loop is going to be slower than just doing the 5 lines. I think what you’re doing is just fine TBH.

 

You could also go random but looks like these are precise values you’re animating visually, not totally random.

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks, that's kinda of what I was thinking, I don't want to overkill code for the sake of it (as I'm too dumb for that! :-) ) and replace 5 lines of code with some 15 line function.

 

Thanks.

Share this post


Link to post
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.