I have read a lot of forms and answers stating that the solution to changing a gameObjecs pivot point is to parent it to an empty game object. I guess this could work with what I am trying to do but I think it will cause a lot of problems that I would not encounter if I could just simply move the pivot point.
What I am looking for is a simple way to change the pivot point in a script just as you would in the inspector. I don’t understand why I can’t simply set an objects pivot to a vector2 like you set the position, rotation, and scale with a vector3. In the inspector, I can change the pivot point just fine, it even clamps the value between 0 and 1 the way I want it to.
So what I am trying to achieve is zooming in on my games map. My map is in a scrollRect (horizontal, vertical, clamped movement type). I used this tutorial by Jason Weimann on how to zoom and item by changing its scale. This works fine but when scaling the image, it shrinks and expands in on the pivot point. I would like to change the pivot point to my mouse position so that you zoom in and out on your cursor. I think this would feel more natural.