Hello,
I have a gameobjects that user can move in 2D world. I have add several additional buttons around this objects so user could control size and rotation.
rotateButton.GetComponent<RectTransform>().position = new Vector2(Input.mousePosition.x, Input.mousePosition.y + 74);
My first problem is that magic number ‘74’. It looks nice in editor but terrible in build. How I can replace it in relative offset to gameobject?
My second problem is that when i scale object my mouse is on control button so i can’t position control panel based on mouse position as in code above. This results in control menu overlap with gameobjects. How to make them scale / change offset based on another gameobjects size (scale) or rotation.
Thanks!