- Home /
No collision detection with back faces in voxel game. HELP!
Hello everyone!
I'm creating a voxel game in Unity (sth. like Minecraft), and i've got a serious problem: There's no collision with backfaces (back, left and bottom block faces do not have collision). I've already tried switching all normals to positive or replacing left face with right face - 1.I think that Unity or physics engine recalculates normals somewhere, what makes backfaces come back.
PLEASE! Help me, my project is stopped for this reason and i've no idea!
Answer by Bunny83 · Nov 09, 2012 at 10:22 PM
The vertex normals are just used for lighting calculations in the shader. The direction a triangle is facing is dertamined by it's winding order. In modelling applications this is often called "face normal".
If a face points in the wrong direction, just reverse the winding order of it's vertices by exchanging two of them. Something like that:
0, 1, 2 --> 1, 0, 2
It doesn't matter which indices you exchange.
edit
Just in case you haven't seen it, there's a Unity Minecraft starter package
Thank a lot. I've combined these triangles with flipped indices, with a normal ones creating a double-sided polygons where needed and it works fine.
Your answer
Follow this Question
Related Questions
Voxel engine physics 1 Answer
Voxel spaceship collider 1 Answer
Voxel engine physics 3rd person character controller 1 Answer
Rigidbodies won't collide if mass difference is too high 0 Answers
Detailed terrain mesh collision 1 Answer