A_ChangeVelocity
From ZDoom Wiki
A_ChangeVelocity (float x, float y, float z, int flags)
- x: velocity on x axis (or forward and backward).
- y: velocity on y axis (or side to side).
- z: velocity on z axis (up and down).
- flags: The following flags can be combined by using the | character between the constant names:
- CVF_RELATIVE — Relative axes: Make x, y relative to actor's current angle. This is the same as using 1 in the flags parameter.
- CVF_REPLACE — Relplace old velocity: Replace old velocity with new velocity. This is the same as using 2 in the flags parameter.
A_ChangeVelocity changes the calling actor's velocity on each axis. If the "relative axes" flag is set, the "x" argument will represent forward and backward movement and the "y" argument will represent side-to-side movement. If the "replace old velocity" flag is set, the actor's velocity will be set to the new velocity; otherwise, the new velocity will be added to the old velocity.
See also
For a less complicated way to modify an actor's velocity, try A_ScaleVelocity.