Hello, Im trying to reposition an offscreen GameObject (B) on its nearest screen border point (C). As you can see on this image. A is screen center point.
My first approach was to get the angle between A and the top center screen point (D on next image) in order to later calculate the angle between that and AB and finally get somehow C… But I cant even get started because Vector2.Angle returns the red angle shown on second image, and not a 90º as I would expected for AD…
Do you know a way to get the angles as I expected (and not from screen 0,0 point) or could you suggest me a different approach? Thanks.