How I can know surface angle?

Hi, I have to know rotation of surface i’m looking, but I dont know how I should implement it? I’m not searching complete code, but even idea how I could do that?

Like this, arrows are showing surfaces, I need to know rotation of surface i’m looking. I was thinking multiple raycasts, but not sure how to implement that. Any idea?


EDIT:

New picture (I’m bad at describing, sorry!), maybe it helps someone.

^ This raycast should find angle information.

A raycast hit contains the “.normal” attribute, which is a Vector3 representing the hit plane’s normal (the direction its “outside” face is facing).

You can use Vector3.Angle(normal, yourRay) to get the angle between those, if that’s what you’re looking for.

Don’t break your head i found the simplest and best answer for calculation…
RaycastHit has a transform in which it is linked to the collider once it is called

Rayhit.transform.eulerAngles

‘’

var Rayhit: RaycastHit;
var HitRay= Physics.Raycast(transform.position,transform.forward,Rayhit,1);
if(HitRay)
print(Rayhit.transform.eulerAngles.y);

‘’