VelFromAngle

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

Note: This feature is for ZScript only.

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
   }
}

This article is issued from Zdoom. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.