# UI Rotation scaling question

Heyo! Tave here and I’ve got a question, so recently I wanted to mess around with some UI stuff of designs that randomly popped up in my head and had just been trying to learn more about some tweening with it. So the question is pretty simple and that is, is it possible to set a sort of origin and end point for a UI? I’ve searched this up and had no luck so I thought to send it to dev forums. If you have any knowledge on this and are willing to share, thank you!

1 Like

You could always define the goal of your tween, if that’s what you’re asking.

``````local startGoal = UDim2.new(0,0,0,0)
local endGoal = UDim2.new(0.3,0,0.2,0)

if GUIObject.Position == startGoal then
GUIObject:TweenPosition(endGoal),"InOut","Sine",0.5)
end
``````

Ah I think I see where I when wrong when making this post, I wrote it pretty fast so let me rephrase.

So I will follow the title properly this time lol

Anyways, what I was truly willing to ask was how would I keep an origin point when a UI is rotated as the center point gets shifted, is there a certain function I can use to counter this? For an example of this, I’ve included a video.

https://gyazo.com/676929ae3d1c66ebe10087d036a0d2a4

So lets assume that the corner of the letter “a” is my origin point and as you can see when I stretch the UI, its position shifts. I have not tried coding this together yet because i’m just trying to gather information before I start. Thanks!

I think you mean the anchor point, there is no true origin point in Roblox Studio. Anchor Point works very similar though, set it to 0.5,0.5 and that is the middle of the UI Object. then you can do anything with it, it will act as a origin point for Resizing, Positioning and Rotating.

I didnt see any differences but its okay, just calculated the positions and used a renderstep to make an anchor point in between both points