I think “viewport” and “screen” coordinates may actually be different, at least when using “cinematic camera” or letterboxing, so that might be something to watch out for.
Atan2() looks like this:
It takes a position in X and Y, in math-style coordinates (X to the right, Y upwards on a piece of paper) and returns the angle from the origin to that point. (Obviously it doesn’t work when the X and Y values are exactly 0,0 !)
(Also, oops, in the picture I wired X to Y and Y to X, which will return the degrees rotating the other way … feel free to wire it up correctly when you use it
)
A reasonable description can be found here:
The wikipedia page on the function is … complete, but not beginner friendly…
