Change Height in rectTransform via script ???

OK in the Editor Rect Transform has a Height field but why can’t I resize the component by changing the height value directly via script?

The rectTransform’s rect component is read only???

Am I missing a simple function or property to change this value?

1 Like

Try deltaSize.

1 Like

Yep that’s the one. Not intuitive though, maybe you could redirect programmers in the docs looking at the rect component to the deltaSize element for changing the width/height of a component.

And improve the deltaSize docs with an example and maybe some diagrams as I’m guessing this is tied into the scaling and UI layout elements.

1 Like