Back to wiki
This post is unpublished.
Double check all the info, and if it's ready, click the "publish" button in the post summary.

Completly Stopping Momentum

Author:
LazyLion

Category:
Tutorials

Posted:
4 months ago

Revisions:
17 revisions

Last updated:
2 months ago

Cancel Contrary Motion Method

Cancel Contrary Motion only stops motion in the opposite direction of impulse is applied. When impulses are applied in the 6 unit vector directions it cancels all previous motion. Cancel Contrary Motion requires a non-zero speed for it to cancel the opposite forces.

Cancel Contrary Motion Example:

actions
{
    Apply Impulse(Event Player, Down, 0.001, To World, Cancel Contrary Motion);
    Apply Impulse(Event Player, Up, 0.001, To World, Cancel Contrary Motion);
    Apply Impulse(Event Player, Backward, 0.001, To World, Cancel Contrary Motion);
    Apply Impulse(Event Player, Forward, 0.001, To World, Cancel Contrary Motion);
    Apply Impulse(Event Player, Right, 0.001, To World, Cancel Contrary Motion);
    Apply Impulse(Event Player, Left, 0.001, To World, Cancel Contrary Motion);
}

Incorporate Contrary Motion Method

Incorporate Contrary Motion method applies two impulses in the opposite direction at the speed of the player.

Incorporate Contrary Motion Example:

actions
{
    Apply Impulse(Event Player, Multiply(Velocity Of(Event Player), -1.000), Speed Of(Event Player), To World,
        Incorporate Contrary Motion);
    Wait(0.048, Ignore Condition);
    Apply Impulse(Event Player, Multiply(Velocity Of(Event Player), -1.000), Speed Of(Event Player), To World,
        Incorporate Contrary Motion);
}