VelFromAngle

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


Actor

native void VelFromAngle(double speed = 1e37, double angle = 1e37)

Usage

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

Parameters

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

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