Make Rect Tansform grow only in positive Y-Axis direction

Hello everybody,

I’m working on a prototype for a game chat. It’ll turn out as a pretty mainstream one, which can be seen in Dota2, Warcraft3, Diablo, and so on.

I’m struggling now with the Rect Transform of my GameObject holding the text component with all the chat’s text. I attached a content size fitter, so that the rect transform expands itself on runtime. But it scales up in both direction of the Y-Axis. I would like to make it just increase in the positive Y direction (upwards).

How can I achieve this without adjusting the position by script?

It is all about the RectTransform’s pivot.

Applying this snippet to the content of the ScrollRect helps!

void Start () 
    {
        RectTransform rectTransform = GetComponent<RectTransform>();
        rectTransform.pivot = new Vector2(transform.pivot.x, 0);
	}