How to reposition a frame using Vector2

How would I reposition a frame using Vector2

I am pretty sure that you use the Udim2 property instead of vector2 but the way you would do that would most likely be:

Frame.Position = Udim2.new(0,Vector2.X,0,Vector2.Y)

Alright thanks for the heads up, ill try this and get back to you

1 Like

You know you don’t have to make a whole new topic to write about a question. Also please give more detail when writing a question or feedback so we can understand you easily. And please read the rules of the dev forum for more detail. About the Scripting Support category

Its pretty straight forward,

"How do you reposition a frame using Vector2"

Have you tried using a script or making one on your own?

So I already have a function that gets the center of an object I pass, problem is when settings position; I cant use Udim2

does the Frame.Position = Udim2.new(0,Vector2.X,0,Vector2.Y) work? I tried doing that myself and you may have to add/subtract some sort of offset for it to work properly but it works.

You could make a vector 2 value, and make sure the x and y are numbers 1-100. Then use scale instead of pixels.

Frame.Position = Udim2.new(Vector2.X/100, 0, Vector2.Y/100, 0)
1 Like