unity3d-runtime-debug-draw icon indicating copy to clipboard operation
unity3d-runtime-debug-draw copied to clipboard

Text bugs out when it is behind camera

Open joshcamas opened this issue 6 years ago • 1 comments

This has to do with the fact that there isn't a check if the text is in front or behind the camera. This results in strange issues.

The fix simply involves checking if the world position of the text object is in front of the camera when running GUIDrawTextEntry or GUIAttachTextEntry:

` Vector3 worldPos = entry.anchor;

Vector3 heading = worldPos - camera.transform.position;

if (Vector3.Dot(camera.transform.forward, heading) <= 0)

return;

`

joshcamas avatar Jan 31 '19 23:01 joshcamas

Added a pull request that should fix this issue: #8

JohannesMP avatar Jan 16 '20 23:01 JohannesMP