SignedAngle returning wrong angles
In my code I have 2 points that my NPC navigates between in a 2D space. I use SignedAngle to get degrees the character should face (the angle between the point they are at and the point they are going to) and then use that to set their rotation. The angles are consistently incorrect for some reason. For example, even if both points are at the same x or y position, the angle won't be straight.
Here is my code:
nextPoint = (curPoint + 1) % points.Length;
movementToNextPoint = new Vector2((points[nextPoint].position.x - transform.position.x) / timeBetweenPoints, (points[nextPoint].position.y - transform.position.y) / timeBetweenPoints);
degreeFacing = Vector3.SignedAngle(transform.position, points[nextPoint].position - transform.position, Vector3.forward);
transform.rotation = Quaternion.Euler(0, 0, degreeFacing);
curPoint = nextPoint;
Is there anything wrong with this code? I'm really not sure what's wrong here, because the code seems to work on the first run but starts being incorrect afterwards. Thank you.