Jump to content
Search Community

Draggable with throwProps: true and Callback Function

PopWarner 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

Greetings,

 

Hope this isn't too newbie of a question.  Looking to subscribe to the club and I'm playing with some of the bonus plugin's via the CodePen sandbox. I really like the draggable when combined with the throwprops plugin. I was curious, is there a way to call a function at the end of a "throw".

 

In the sample pen, I added the throwProps plugin, so I can toss around the icons, which is perfect. But I was hoping to "toss them into the bag" in the sample. The problem is that how the sample is setup, the hitTest is based on dragging with my cursor. So when I "throw" the icon over to the bag, even though it lands on it, the hitTest function doesn't fire because it's associated to the onDrag event.

 

Is there a way to fire the hitTest once the icon has landed in it's final spot or track it's location as it's being thrown across the space. 

 

Thanks in advance. :)

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

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