2
$\begingroup$

I am modeling some objects in blender 2.79 for a unity game. I can import the model perfectly and I also can see textures... There is just one error in unity shown up: "A polygon of [modelname] is self-intersecting and has been discarded.". This error effects, that the model can't get a meshcollider (hitbox exactly fitting to the model). I found out, that it's often not working when I fill more vertices than 4. For example like this:

enter image description here

But that might be wrong also. I already removed doubles and the error still appears in unity. Could anyone tell me please how I can avoid that error or at least get the hitbox correctly? Thank you for your help! For more questions about the problem -> just ask me in the comments :P

$\endgroup$
  • $\begingroup$ Could you upload your model? $\endgroup$ – yann Feb 7 '18 at 22:46
  • $\begingroup$ This isn't an ideal solution, but maybe you could add a remesh modifier and then export $\endgroup$ – Dr. Farquaad Feb 8 '18 at 3:56
2
$\begingroup$

Based on what I see in the image you posted and as you said yourself, the main problem is the fact that your model has N-gons, which is a polygon made of 5 or more vertices, in your case that is the top face. Unity actually struggles with N-gons, so it is best to make the model with only Quads and/or Triangles. Try deleting the top face and make two faces like the ones you have on the front of your model. To make sure this is actually the problem, check if the black dot on the top face is actually at the center of that face, if not you definitely have an N-gon there. Otherwise (=if the black dot is in the center of the face) the problem could also be that the middle vertex on the top (red circle in the image below) might not be attached to the top face. Either way the ideal solution should be creating two top faces like the one I highlighted in the image below.

ideal solution

$\endgroup$
1
$\begingroup$

I wrote a short article here, if this helps you give it a view, will ya?

Without going into details(not because I don’t want to, because I don’t know) I will share what I did to get rid of it.

  1. Remove double faces : Select the object, go to edit mode, select Vertex Mode(I am not sure if Vertex mode should be selected or Face Mode), go to wireframe view(shortcut Z), select everything (Press ‘B’ then drag to select all Vertex/face), then on the left side in the toolbar find and press “Remove Doubles”. This video might help you, you will find I did not follow the instructions exactly.
  2. Search for “ngon”s in your scene and convert them to quad: This article did a great job in explaining how to do it. So I am just gonna link to it.

These two steps fixed the error for me. Good luck!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.