Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text bugs out when it is behind camera #7

Open
joshcamas opened this issue Jan 31, 2019 · 1 comment
Open

Text bugs out when it is behind camera #7

joshcamas opened this issue Jan 31, 2019 · 1 comment

Comments

@joshcamas
Copy link

joshcamas commented Jan 31, 2019

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;

`

JohannesMP added a commit to JohannesMP/unity3d-runtime-debug-draw that referenced this issue Jan 16, 2020
@JohannesMP
Copy link
Contributor

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

JohannesMP added a commit to JohannesMP/unity3d-runtime-debug-draw that referenced this issue Jan 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants