Jump to content
Search Community

RotateY when the object moves from left to write, then back to current view.

Muc test
Moderator Tag

Recommended Posts

Hi @Muc and welcome to the GSAP Forums!

 

There is no rotation on the Y axis in SVG, just plain 2D rotation, nothing more. Is not a GSAP issue just the way things are with SVG. I'm afraid that your bee is just drawn in the wrong direction.

 

I made a few tweaks to your demo and also added the pathEase helper function that Jack created to help in this cases:

See the Pen wvZdpwL by GreenSock (@GreenSock) on CodePen

 

Is worth noticing that it would be better to avoid your path to have up and downs in it in order to avoid those sudden jumps in the animation as shown in this demo:

See the Pen GRoXzYj by GreenSock (@GreenSock) on CodePen

 

Hopefully this helps.

Happy Tweening!

Link to comment
Share on other sites

Alright, I couldn't help myself - I just had to find an algorithm to try to smooth out the movement when the path goes backwards. After about 10 hours, I think I've figured it out, and also demonstrated how you can make the bee kinda twist itself to remain oriented in the direction it's moving using scaleX and scaleY: 

 

See the Pen mdgmawg?editors=0010 by GreenSock (@GreenSock) on CodePen

 

Notice that pathEase() helper function has been updated and you can pass in a config object with smooth: true

 

I hope that helps!

  • Like 2
  • Haha 1
Link to comment
Share on other sites

On 3/23/2024 at 5:10 PM, GreenSock said:

Alright, I couldn't help myself - I just had to find an algorithm to try to smooth out the movement when the path goes backwards. After about 10 hours, I think I've figured it out

Everything just fine and normal in GreenSock tower 😂

giphy.gif

  • Haha 2
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...