How to set the anchoredPosition of a RectTransform via script in Unity3D -
i trying set anchoredposition of ui image instance programmatically. have tried these ways:
getcomponent<recttransform>().anchoredposition=new vector2(0,0);
and
getcomponent<recttransform>().anchoredposition.set(0,0);
but none of above seem work. infact when run program, in inspector says anchoredposition (0.5,0.5). , puts image likes. that?
Comments
Post a Comment