GetActorPitch
From ZDoom Wiki
int GetActorPitch (int tid)
Usage
Returns the actor's pitch.
Parameters
- tid: TID of the actor. Passing 0 will get the activator's pitch.
Return value
The actor's pitch is a fixed point angle. Due to the limits of freelook in the software renderer, this value is bounded by -0.0888977 and 0.155548 (-5825 and 10194 as ints), but in GL freelook will go from -0.25 to 0.25. Note that looking up produces a negative value and looking down produces a positive value. 0 is looking straight ahead.
Examples
This script will alter the trajectory of a DoomImpBall fired from a thing with a tid of 1 based on the pitch of the activator.
script 1 (void)
{
int speed, vspeed;
speed = cos(GetActorPitch(0)) * 64 >> 16;
vspeed = -sin(GetActorPitch(0)) * 64 >> 16;
SpawnProjectile(1, "DoomImpBall", 0, speed, vspeed, 1, 0);
}
For more advanced uses, see the Cleaned_up_Third_Person_Cam tutorial or the hudmessageonactor function.