Calculating Angle between Hero object and rounded object

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

I don’t seem to be able to see the picture. Can you check the link to the image file or else give a bit more detail about the problem?

So is this like a space satellite that shoots a laser at or takes a picture of something on the ground?

I edited the post, seems the filehoster is down.

@ gypsy fly

Yeah, essentially thats what I’m looking for