Jump to content
Search Community

[question] using physicsprops to add functionality to draggable

hellol11 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

So, I have a small problem. I want to be able to customize things in the throwprops plugin, like friction and bounciness. But it doesn't let you do anything like that, so I wondered, is it possible to combine the functionality of the two plugins?

Link to comment
Share on other sites

jimeast, edgeResistance applies to when you are dragging something with Draggable. Friction is applied to physics-based tweens.

 

hellol11,

 

ThrowPropsPlugin has velocity tracking capabilities

 

http://greensock.com/docs/#/HTML5/GSAP/Plugins/ThrowPropsPlugin/getVelocity/

 

so technically it is possible to get the velocity of something and apply that value to a Physics2D or PhysicsProps tween.

 

However ThrowProps already does pretty much the same thing with the added benefit of allowing min and max values, overshoot tolerance and resistance (friction). Have you read up on the ThrowPropsPlugin.to() method? http://greensock.com/docs/#/HTML5/GSAP/Plugins/ThrowPropsPlugin/to/

 

Note, none of the physics tools have any built-in collision detection, nor do they naturally handle bounciness (outside of Bounce ease as Zach mentioned).

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