private void SetPositionInSongInMillis(double positionInSongInMillis) { float x = (float)noteArea.GetHorizontalPositionForMillis(positionInSongInMillis); rectTransform.anchorMin = new Vector2(x, 0); rectTransform.anchorMax = new Vector2(x, 1); rectTransform.anchoredPosition = Vector2.zero; rectTransform.sizeDelta = new Vector2(rectTransform.sizeDelta.x, 0); }