VelFromAngle

From ZDoom Wiki
Jump to navigation Jump to search
Note: This feature is for ZScript only.


native void VelFromAngle([double speed[, double angle]])

Usage

Sets the actor's xy velocity based on the provided speed and angle.

Parameters

  • speed - Default is 1e37 which tells GZDoom to use the Actor's speed property. The speed of the Actor's new velocity
  • angle - Default is 1e37 which tells GZDoom to use the Actor's current angle. The direction of the Actor's new velocity

Examples

void A_SpawnImpBall()
{
   let missile = Spawn("DoomImpBall", pos + (0,0,32));
   if (missile)
   {
       missile.target = self;
       missile.angle = angle; // Set the missile's angle to the Imp's
       missile.VelFromAngle(); // Launch the Imp ball in the direction the missile is facing using the missile's speed property
   }
}