GetActorVelY
From ZDoom Wiki
int GetActorVelY (int tid)
Usage
This returns the velocity of the actor along the Y axis. Positive values means northward movement; negative values are southward.
Parameters
- tid: TID of the actor.
Return value
The Y velocity of the actor, as a fixed point value.
Examples
This example prints the angle that the player is moving in based on x and y velocity.
script 1 enter
{
int angle;
while (TRUE)
{
angle = VectorAngle(GetActorVelX(0), GetActorVelY(0));
print(f:angle);
delay(1);
}
}
This example prints the current speed of the player. It uses the sqrt function which must be included. Note that the fixed point variant of sqrt is used.
script 1 enter
{
int x, y, z, speed;
while (TRUE)
{
x = GetActorVelX(0);
y = GetActorVelY(0);
z = GetActorVelZ(0);
speed = FixedMul(x, x) + FixedMul(y, y) + FixedMul(z, z);
print(f:sqrt(speed));
delay(1);
}
}