A_FaceTarget
From ZDoom Wiki
A_FaceTarget [(float angle)]
Changes the calling actor's angle to face its current target.
If angle is specified, then the calling actor cannot turn by more than said angle. (A value of 0 is interpreted as unlimited angle.) However, the SHADOW flag has no effect in such case. (New from 2.5.0)
Examples
Almost every monster uses this function before it shoots at its target.
Missile: TROO EF 8 A_FaceTarget TROO G 6 A_TroopAttack // See DoomImpBall goto See
This lost soul will home in on its target by calling A_FaceTarget repeatedly.
actor HomingLostSoul : LostSoul
{
States
{
Missile:
SKUL C 10 bright A_FaceTarget
SKUL D 4 bright A_SkullAttack
SKUL CD 4 bright
SKUL C 0 bright A_FaceTarget
goto Missile+2
}
}