Jump to content

Search In
  • More options...
Find results that contain...
Find results in...


Sign in to follow this  

| GreenSock

Provides simple physics functionality for tweening an object's x and y coordinates (or "left" and "top") based on a combination of velocity, angle, gravity, acceleration, accelerationAngle, and/or friction. It is not intended to replace a full-blown physics engine and does not offer collision detection, but serves as a way to easily create interesting physics-based effects with the GreenSock animation platform. Parameters are not intended to be dynamically updateable, but one unique convenience is that everything is reverseable. So if you spawn a bunch of particle tweens, for example, and throw them into a TimelineLite, you could simply call reverse() on the timeline to watch the particles retrace their steps right back to the beginning. Keep in mind that any easing equation you define for your tween will be completely ignored for these properties.


TweenLite.to(element, 2, {physics2D:{velocity:300, angle:-60, acceleration:50, accelerationAngle:180}});

See the Pen Physics2D Demo by GreenSock (@GreenSock) on CodePen.

Learn more in the Physics2DPlugin documentation.

Get an all-access pass to premium plugins, offers, and more!

Join the Club