UV coordinates aren't imported/are screwy

Hi, I made a model, UV mapped it, saved it as an .OBJ, and imported it into Unity(along with the texture). I made a material for it, added the texture to the material, and added the material to the object(model). However, the UV cords are all messed up. It doesn’t look anything like it did in my modelling program.
Did I screw up somewhere in the importing of my assets? Or what?

P.S. I didn’t really know of any good tags to add to this, sorry.

4 Answers

4

Click on your model in the Assets/Project Pane, and under the FBX import option, click on ‘Swap UVs’ and see if that sorts them out.

This worked! Now I wonder why...

In your original question, the direction of the ray was given by origin.transform.forward, not just transform.forward. Are you sure those two objects get rotated to point the desired direction? If you want to get the point you've clicked on, you must use ViewportPointToRay method ( doc )

based on some more research, i think my problem is just something that unity does, thank you for all your help and I am so sorry for any inconvenience caused :)


We have had this happen to us. Legacy projects mostly. Only solution was to start new project. The same model breaks in Unity on one project and works fine in the new one. No idea why.

I personally experienced this. After trying everything from removing repeat on textures to even attempting to hand repair the UVs, it ended up being due to Unity itself. One new project later, a few moments lost rebaking light and resetting up materials, I am back in business. This is an underrated solution and deserves more upvotes. The sad part is this is still an issue 4 years later, and the fix you suggested here still remains viable.

What 3D application are you using?

I’ve seen similar issues when people are exporting from 3Ds max and have either open holes in their mesh or have 2 vertices that are in the exact same position. If you are using 3Ds max, then there should be an error when you are exporting saying that the UV coordinates are wrong, you can solve this by selecting all the vertices on your model and use the “weld tool” with the weld radius set to a value very near 0.

If you are not using 3Ds max, then i am not sure what the problem could be, but you could always try messing around with the exporter :slight_smile:

public void Shoot() { RaycastHit hit; if (cm.glareOn == true) { if (Input.GetMouseButtonDown(0)) { GameObject bullet = Instantiate(lightbullet, origin.transform.position, Quaternion.identity); if (Physics.Raycast(origin.transform.position, transform.forward, out hit)) { Debug.Log(hit.point); target = hit.point; } } } }

for clarification this is from the player controller :)

Mostly its because of fbx exporter’s fault. I dont know the reason but I know the solution. Export your object as obj file, then import in max, than re-export as fbx. It should be work. This is the solution.

yep,i checked