Search Issue Tracker

Fixed in 5.5.0

Votes

31

Found in

5.0.1f1

Issue ID

699563

Regression

Yes

RaycastHit returns the wrong triangle index in Unity 5

Physics

-

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.

Comments (9)

  1. panta

    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 :(

  2. PrawnJeremy

    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.

  3. PrawnJeremy

    Feb 03, 2016 07:03

    Any news on a fix?

  4. PrawnJeremy

    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?

  5. yant

    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.

  6. Carelw

    Sep 11, 2015 08:48

    When will this be fixed?

  7. PrawnJeremy

    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.

  8. kierand

    Jun 24, 2015 12:34

    Still happening in 5.1.1p1. What release will the fix be in?

  9. kierand

    Jun 23, 2015 16:48

    I can also confirm that this happens in 5.0.1p3.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.