|Note: This feature is for ZScript only.|
double deltaangle (double angle1, double angle2)
Used to find the relative change from one angle to another, because raw actor angles may not always be normalized. For example, the player's angle variable can return inconsistent results if the player has turned a complete circle.
If you need to check only the difference between the angles regardless of direction, consider AbsAngle instead.
- angle1: The first angle to be compared.
- angle2: The angle to be subtracted from the first.
- The difference between the two angles, normalized to between [-180,180].
if (target && deltaangle(angle, AngleTo(target)) < 20)