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

Popular posts from this blog

javascript - Create websocket without connecting -

how to do line continuation in perl debugger for entering raw multi-line text (EOT)? -

android - Linear layout children not scrolling -