L. A.
L. A.

Reputation: 51

How to display text on Tilemaps

Currently, I'm developing a hexagonal tilemap game. Every tilemap is a player and I need to display their scores on them. How can I do this?

Upvotes: 2

Views: 1024

Answers (1)

Sven Viking
Sven Viking

Reputation: 2720

One way would be to create a prefab with your text setup (e.g. a worldspace TextMeshPro object), and then instantiate them using Tilemap.GetCellCenterWorld() to get the appropriate positioning for relevant tiles. Get the text object using GetComponent<TextMeshPro>() so you can change the text etc.

Upvotes: 1

Related Questions