Skip to content

Text bugs out when it is behind camera #7

Open
@joshcamas

Description

@joshcamas

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;

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions