2dtext on sprite

how can i put (attach) 2d text on sprite?
i want text be in sprite district.
and can change it in code.

You could do a collider and then make it so when something that you want is close enough to the sprite the text comes up. I would try using unity’s 3D text instead of 2D. It would be easier to use for what you want I think.Or you could just make a GUI come up on screen but I dont think that is what you want.

i cant understand the soloution.