Parabolic Tween Behavior

Dream it, build it!

Parabolic Tween Behavior

Parabolic Tween

The parabolic tween behavior allows you to build parabolic trajectories easily. You can either set a parabola by a given point in space, or you can throw a projectile in a parabolic target by an angle and a force. This is useful in many use cases, for instance, in a 2D isometric game you can simulate jumps, or on a 2D american football game you can throw a ball to the runner.

Properties


PropertyDescription
EnabledEnables/disables the behavior.

Actions


Set Enabled

Disable/Enable the Parabolic Tween behavior

Set Parabola from Velocity

Constructs a parabolic trajectory prediction based on the initial velocity of the object.

ParameterDescription
TagTag to identify the parabola.
VelocityInitial velocity of the object in pixels per second.
AngleAngle
GravityWorld gravity

Calculate by target

Calculates the initial velocity and angle of the parabola based on a given point in space that must be reached at a specific time.

ParameterDescription
TagTag to identify the parabola.
XTarget X coordinate
YTarget Y coordinate
TimeTime in seconds to reach the destination
GravityWorld gravity.

Tween Parabola

Tweens a pair of coordinates over parabola from the current object coordinates to a Specified target coordinate.

ParameterDescription
TagTag to identify the parabola.
XTarget X coordinate
YTarget Y coordinate
TimeTime in seconds to reach the destination
GravityWorld gravity.
Set AngleSets the angle of the object to follow the parabolic path

Stop Tween

Stops the specified tweening parabola and Triggers the On Finished conditions.

ParameterDescription
TagTag to identify the parabola.

Stop All

Stops all the running tweens and Triggers the On Finished conditions.

Resume Tween

Resumes the specified paused and uncompleted tween

ParameterDescription
TagTag to identify the parabola.

Resume All

Resume all the paused and uncompleted tweens

Pause Tween

Pauses the specified tweening parabola

ParameterDescription
TagTag to identify the parabola.

Pause All

Pause all the running tweens

Conditions


Is Enabled

Returns true if the Parabolic Tween behavior is enabled

On Finished

Triggered for the specified tweening Tag when tween is completed

ParameterDescription
TagTag to identify the parabola.

On Any Finished

Triggered when any tween has finished

ParameterDescription
TagTag to identify the parabola.

Is Playing

Returns true if the specified tag is tweening

ParameterDescription
TagTag to identify the parabola.

Is Any Playing

Returns true if any tween is running

Expressions


GetTag

In 'On Any tween finished' event, returns the finished tag.

GetTweenMaxTime

Returns time set for the specified tweening parabola

ParameterDescription
TagTag to identify the parabola.

GetProgress

Returns progress percentage from 0 to 1 of the tween with the specified Tag

ParameterDescription
TagTag to identify the parabola.

GetXAt

Returns the X coordinate of the parabola at the given time in seconds. This expression is only valid after calling either actions 'Set Parabola from Velocity' or 'Calculate by target'.

ParameterDescription
TagTag to identify the parabola.
TimeTime in seconds to reach the destination

GetYAt

Returns the X coordinate of the parabola at the given time in seconds. This expression is only valid after calling either actions 'Set Parabola from Velocity' or 'Calculate by target'.

ParameterDescription
TagTag to identify the parabola.
TimeTime in seconds to reach the destination

GetVelocityX

Returns the initial Velocity-X vector after calling CalculateByTarget action

ParameterDescription
TagTag to identify the parabola.

GetVelocityY

Returns the initial Velocity-Y vector after calling CalculateByTarget action

ParameterDescription
TagTag to identify the parabola.

GetVelocity

Returns the initial velocity vector after calling CalculateByTarget action

ParameterDescription
TagTag to identify the parabola.

GetAngle

Returns the initial angle after calling CalculateByTarget action

ParameterDescription
TagTag to identify the parabola.

GetX

Returns the X Coordinate of a Tweening Parabola

ParameterDescription
TagTag to identify the parabola.

GetY

Returns the Y Coordinate of a Tweening Parabola

ParameterDescription
TagTag to identify the parabola.

GetProjectileAngle

Returns the heading angle of the projectile while tweening over a parabolict trajectory

ParameterDescription
TagTag to identify the parabola.

GetProjectileAngleAt

Returns the heading angle of the projectile while for a specific point in time of a parabola after calling 'Set Parabola from Velocity' or 'Calculate by target'

ParameterDescription
TagTag to identify the parabola.
TimeTime in seconds

By Pixel Perfect Studio

https://www.imcsw.com