Answers for "Changing Pivot of rotated RectTransform makes the Object jump to an incorrect Position"
http://answers.unity.com/questions/1405606/changing-pivot-of-rotated-recttransform-makes-the.html
The latest answers for the question "Changing Pivot of rotated RectTransform makes the Object jump to an incorrect Position"Answer by Roywise
http://answers.unity.com/answers/1405697/view.html
A colleague has found a solution for the problem I was having. Here's the solution we're currently using.
private void changePivot(Vector2 pivot)
{
Vector2 deltaPivot = RectTransform.pivot - pivot;
float deltaX = deltaPivot.x * RectTransform.sizeDelta.x * RectTransform.localScale.x;
float deltaY = deltaPivot.y * RectTransform.sizeDelta.y * RectTransform.localScale.y;
float rot = RectTransform.rotation.eulerAngles.z * Mathf.PI / 180;
Vector3 deltaPosition = new Vector3(Mathf.Cos(rot) * deltaX - Mathf.Sin(rot) * deltaY, Mathf.Sin(rot) * deltaX + Mathf.Cos(rot) * deltaY);
RectTransform.pivot = pivot;
RectTransform.localPosition -= deltaPosition;
}Mon, 11 Sep 2017 15:14:26 GMTRoywise