Hey guys,
I’m currently having a little problem with the calculation of angles.
Here is a little illustration:
I need the angle between a parallel of the x-axis, which goes through the center of my hero object, and a local raycast which hits a rounded object.
I experimented a bit with Vector3.Angle, but the calculation seems to work from the Vector3.zero point, which isnt working in my case. I need the starting point to be the center of the object, the 2 points should be the hitting point of the local raycast and the hitting point of the parallel to the x-axis.
I want to achieve, that the hero object adapts his rotation depending on the surface of rounded objects.
Thank you very much