| Reference | Downloads | Github

Accessing a polygon object's value and putting it into text


If I try to access a polygon object’s value and put it in a text.text=myVal, i get Hello world! i.e. it is not working. I used to be able to do this before.

It doesn’t matter if str(myVal) or int(myVal). I can’t recollect what i used to do differently before. any ideas?


Is myVal the name of your polygon component?

No, it’s polygon.size.x


Try polygon.size[0]

Can’t you use the variable you use to set the size?

It only works if it is a text. And doing str() goes t help.


Try printing polygon.size to the console to see if it has a value.

I assume your polygon is called polygon