Hi there.
I try to change a canvas position by c# command:
public void SwitchWindows()
{
ContainerWindow.GetComponent<RectTransform>().position = new Vector3(100, -20, 0);
print("Old position: " + ContainerWindow.GetComponent<RectTransform>().position);
ContainerWindow.GetComponent<RectTransform>().position = new Vector3(880, -20, 0);
print("New position: " + ContainerWindow.GetComponent<RectTransform>().position);
}
The final position is kinda odd; there is no miss-scaled parent, no layout component, the position of the window is not driven by anything else! For checking a correct transformation, I make first a step in between (100, -20, 0), print position, then the final one (880, -20, 0), and print position again…
I keep getting this result (look at the prints and the position):