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.
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);