I am trying to figure out how to, via c#, change the topAnchor point in my UIPanel.
Here is how I am trying to go about it:
// The GameObject I want as my new Anchor //
GameObject searchField = GameObject.Find("UI_InfinityScroller/SearchUser");
Transform s = searchField.transform;
// The gameobject in which i want the new Anchor Point //
UIPanel test = GameObject.Find("UI_InfinityScroller/ScrollView").GetComponent<UIPanel>();
test.topAnchor.target = s;
This does nothing. it does not change my topAnchor? I am not sure what i am doing wrong and any help is appreciated.
Thanks in advance :-)