I can’t for the life of me figure this out.
All I want is to obtain the surface normal of a plane that I target. No matter what I seem to do, it never seems to give me the proper normal back.
I use a RaycastHit to store the out from the raycast, and it’s a simple raycast, From camera transform position, in camera.transform.forward direction…
When the raycast succeeds, I simply do a Debug.Drawline from rayhit.point in rayhit.normal direction. The object that I’m hitting has NO apparent bearing on what direction the normal gives back, and the normal direction returned is clearly not the normal of the targetted plane… I simply don’t even know where to begin debugging this, as. Also, when I do a debug log on the object that it hit, it IS colliding with the proper target that I expect it to hit… but again, the .normal is just totally screwy.
I’ve been trying to figure this for about a week now.
I can’t understand if this is something I’m doing wrong, or something wrong with the engine itself.
Has anyone else experienced whackiness with the unity normals as well, or is the general consensus going to be that I’m doing something wrong.
Any help is useful, as I’ve been stuck on this seemingly easy problem for way longer than I care to be.