TextService's GetTextSize doesn't always work in a plugin

When calling TextService:GetTextSize() in a plugin, as soon as the plugin is being created, sometimes, the function returns 0,0 , thus an empty Vector2.

What it should always do:
image

Example of what it does sometimes:
image

Reproduction file, put in the local plugin folder:
Repro.rbxmx (1.6 KB)

2 Likes

This happens when the rendering context hasn’t been created yet, which can happen on the first frame of rendering.

We might be removing the dependency on the rendering context from TextService soon.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.