I am making a hex tilemap, and want to place some objects on top of it from code. One is a sprite, and one is a simple text. Both of them go in a canvas on top of the tilemap.
When i add the sprite (using Instantiate and myHexMap.CellToWorld(new Vector3Int(x, y, 10))), the objects are placed where I expect, and when I move the camera they follow the map.
However, when I add the text in the same way, it is not placed correctly (different coordinates land on basically the same position), and they do NOT move with the camera, and stay on the same spot on the screen.
Seems the difference is that the sprite only has a Transform, and the Text has a RectTransform (as i have tested with other objects).
There must be something basic I am missing here. Can someone point me in the right direction?