Why i can't get Rect Transform

[86605-безымянныи.png|86605]

I think it’s because you write it after return.

Put your GetComponent out of your if statement.

You don’t need to use GetComponent for RectTransform, you can simply cast the transform property.

((RectTransform) transform).position = ...