#Vector2 to UDim2

1 messages · Page 1 of 1 (latest)

tidal salmon
#

Yea bsaciyl how would I tansform a Vector2 into the scale of an UDim2 bcause basicly I wanna place a gui at the mouseposition and the mouseposition is a vector2....

full stream
#

pretty much all youd need to do is subtract the absolute size of the parent frame from the mouse position and divide the new vec2 by the absolute size of the parent
then you can use UDim2.fromScale() to make a udim2 out of the result

tidal salmon
full stream
#

(mousePos - absolutePos) / absoluteSize
assuming the gui object is being placed inside of an existing frame

#

if it isnt in an existing frame the idea is similar but with different values

tidal salmon
full stream
#

the absolute position of the gui

tidal salmon
full stream
#

not of the gui youre placing but the one that the new object is being placed into