Jump to content
Search Community

callbacks at bezier point hits?

geddski test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi @geddski

 

Can you elaborate on this, like what you're trying to do, and what you mean by point? Beziers only go through anchor points. The objects you're animating won't go through the control points.

 

I might have a demo that does something close to what you're asking, but i don't remember if it had curves.  I'll have to check when I get home. 

 

In the meantime,  it would help if you could go into a little more detail about what you're trying to do. 

 

  • Like 1
Link to comment
Share on other sites

On 11/1/2017 at 5:55 PM, geddski said:

I actually just figured out a workaround where I calculate the proximity to the bezier points onUpdate. Thanks though OSUblake!

 

Are you sure about that? Just checking, because there's a bunch of different factors that might cause a distance check to fail:  if your object is moving too fast, browser lag, proximity to other points, and the type of Bezier you are using.

 

Don't know if you are using a "soft" type of Bezier like in the demo you posted, but it's guaranteed to only go through the first and last point. For all the other points, it's only going to go halfway. 

 

It makes more sense when you can actually see the path...

 

See the Pen vWGGGv by osublake (@osublake) on CodePen

 

 

There are ways to add a callback to a specific point on a Bezier, like splitting your Bezier up at those points, and creating separate animations for each segment. If you or anybody really wants to go that route, I can show how. 

 

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