Skip to content

Instantly share code, notes, and snippets.

@kamen-bb
kamen-bb / gist:9f1663983e9338d663d232ca42a38a9d
Created November 23, 2022 15:11
Updating the width or height of a RectTransform runtime
// DO THIS in the Update method, because in Start, element does not have the correct size yet
// Also this method is affected by the pivot point
rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, 100.0f);