- Home /
Raycast Normals Not Orthogonal to Cube Faces
I'm creating a Voxel block game where you can basically place blocks on any of the six sides of another block. The position of the new cube that is placed is simply hit.normal + hit.transform.position (where hit is the RaycastHit of the raycast). This works like 90% of the time, but occasionally the block that is placed will not be orthogonal to a face of an existing cube or it will not be exactly one block away. I looked up the documentation of RaycastHit and it says the normal is normalized (always of magnitude 1), which is the correct amount to move the cube so that it lines up perfectly with the preexisting cube. So why would the cubes show up in a random location which is not normal to a face of the existing cube? This is very mysterious behavior to me.
Your answer
Follow this Question
Related Questions
Make a rolling ball always on ground without falling when reaching the edges of the map 1 Answer
Detemine wich side of a cube was hit 1 Answer
Magical Rigidbody/CharacterController free character...controller - Unity 0 Answers
Picked up cube passes through walls 2 Answers
raycast and detecting if it did hi 1 Answer