Search Issue Tracker
Fixed in 5.5.0
RaycastHit returns the wrong triangle index in Unity 5
Steps to reproduce:
1. Open attached project's "TriangleBug" scene with 4.6 version of Unity.
2. Enter play mode. (have both scene ang game views visible)
3. Point mouse to the track - in scene view triangle gets highlighted.
4. Repeat steps 1-3 with 5.0 - incorrect triangle gets highlighted.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- Graphics.DrawProcedural doesn't work like in DX11 when used with DX12
- [Quest 2] Running Entities Graphics/BatchRendererGroup under Vulkan results in a frame rate drop compared to OpenGLES 3 and causes Tile Binning to cost more
- Filters dropdown: Window doesn't rescale on items collapse
- Sprite Preview is broken when the Sprite is too tall or too wide
- Objects are invisible in Scene view when using Wireframe Shading Mode
Jun 20, 2016 02:28
I'm hitting this in Unity 5.3.2f1 still - is there a fix in the works? It really hurts not being able to use TriangleIndex :(
Feb 03, 2016 19:05
I put together some quick tests and wanted to share the result in case it helps. Doing a mesh cleanup on my mesh to make sure there were no degenerate triangles never fixed the problem which is why I assumed I couldn't do anything about it on my end in the past. However what I found is that if I triangulate the mesh saved to the FBX myself rather than letting Unity do it, the raycast hit seems to return the correct information. So to me, it seems to be an issue with how Unity triangulates meshes.
Feb 03, 2016 07:03
Any news on a fix?
Dec 17, 2015 22:47
Hi Anthony. Thanks for looking into it. There have been several updates in the two months since you posted but this is still active. How is the fix coming along?
Oct 09, 2015 17:13
Hi there - I'm Anthony from the physics team. Thanks for upvoting this. This is a known issue in PhysX 3.3.1 where it won't correctly compute triangle remap indices when degenerate triangles are present. I'm working on getting a fix public soon.
Sep 11, 2015 08:48
When will this be fixed?
Sep 03, 2015 04:27
This bug has broken my game ever since I upgraded to Unity 5 and I obviously can't ship my first game until this is fixed. This regression has been allowed to linger too long.
Jun 24, 2015 12:34
Still happening in 5.1.1p1. What release will the fix be in?
Jun 23, 2015 16:48
I can also confirm that this happens in 5.0.1p3.