Calculate normal vector to the plane that was hit by raycast
Calculate normal vector to the plane that was hit by raycast alt text
How do I go about calculating the red vector in 3D space? I'm using Raycast to hit a gameobject, and I need to create another object with rotation equal to the direction the red vector is pointing.
Info I have available to complete this task is: raycast hit info, and perhaps more, but I'm a noob, and I don't have any skill nor experience in unity, nor am I a good mathematician (I suck at maths)
I have fixed it, I had problems with using wrong Quaternion Euler, ins$$anonymous$$d of Quaternion LookRotation.
The problem I have now, is that the object that I spawn, is HALF-WAY inside the object that I'm clicking at. How do I go about fixing this?
Your answer
![](https://koobas.hobune.stream/wayback/20220612081822im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Accessing Raycast collider from another script 0 Answers
Raycast pointing in the wrong direction 0 Answers
Lighting issues despite not having normals,Lighting not displaying correctly despite no normal maps 0 Answers
How to rotate NavMesh Agent to the surface it is walking on 2 Answers
Optimizing fog of war in 3D environment 0 Answers