Vel3DFromAngle

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


native void Vel3DFromAngle(double speed, double angle, double pitch)

Usage

Sets the actor's xyz velocity based on the provided speed, angle, and pitch. Unlike VelFromAngle this one will properly scale the Actor's velocity on the xyz axes instead of just the xy axes.

Parameters

  • speed - The speed of the Actor's new velocity
  • angle - The direction on the xy axes of the Actor's new velocity
  • pitch - The direction on the z axis of the Actor's new velocity

Examples

void A_Spawn3DImpBall()
{
   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

       // Launch the Imp ball in the direction the missile is facing while vertically aiming for any nearby targets
       missile.Vel3DFromAngle(GetDefaultSpeed("DoomImpBall"), missile.angle, BulletSlope());
   }
}