Jump to content
Search Community

random not working in fromTo

stevg test
Moderator Tag

Recommended Posts

I suspect I'm doing something wrong here, but I can't get the random function (as a string) to work in the 'from' part of a fromTo. However the random function for the delay in the 'to' part is working. Specifically I'm trying to animate each SplitText character to start from a random x y.

 

The Random Values section in the docs here seems to suggest I'm doing it correctly? https://greensock.com/docs/v3/GSAP/gsap.fromTo()

See the Pen ExmmXzj by ste-vg (@ste-vg) on CodePen

Link to comment
Share on other sites

I'll look into that, @stevg but there's a simple workaround - just use function-based values and the utility function: 

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

 

I added rotation: 0.01 to avoid the pixel snapping that some browsers do which makes the motion look a little chunky at the end. Totally unrelated to GSAP - it's just the browser's rendering algorithms at play (thanks, browsers 🙄).

  • Like 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...