ChangeActorAngle

From ZDoom Wiki
Jump to navigation Jump to search

void ChangeActorAngle (int tid, fixed angle [, bool interpolate])

Usage

Sets the angle for the actors with the specified tid. If tid is 0, it sets the angle for the activator of the script.

This function duplicates and extends on SetActorAngle by having the added option to interpolate the view.

Parameters

  • tid: the tid of the actor.
  • angle: the angle to set. This is a fixed point angle in the range of 0.0 to 1.0.
  • interpolate: whether to interpolate the view or not. If true, the view is interpolated, otherwise it is not. Default is false, i.e. no interpolation.

This works to set the facing of monsters, players, or any other actor.

  • North = 0.25
  • West = 0.5
  • South = 0.75
  • East = 1.0

Examples

This is a similar script to the one on the SetActorAngle page. The difference in this is that it takes advantage of the added interpolation option, thus making the spinning smoother.

Script 1 (int spintime)
{
    While(spintime-- > 0)
    {
        ChangeActorAngle(100, GetActorAngle(100) - 0.02, TRUE);
        Delay(1);
        Print(s:"You spin me right round, baby right round like a record, baby right round, round, round");
    }
}