The middle for me is: UDim2.new(0.387, 0,0.458, 0)
Did you scale your UI in size?
Yes, I used a plugin to scale my GUI. It works with every other GUI I’ve done, I don’t think that’s the problem.
If you want it in the middle, set the anchor point of the Ui element to 0.5,0.5
. Then tween the position to 0.5,0,0.5,0
instead and you should be good to go!
Alright well, I put the middle position on my computer into the tween and it works perfectly. When I switch my view to mobile to check the scaling & positioning it’s completely messed up. It’s only the X axis that doesn’t seem to work.
the middle of a frame is determined from a calculation. If your frame is UDim2.new(0.3,0,0.2,0)
then the middle is UDim2.new((1-0.3)/2,0,(1-0.2)/2,0)
As @IFthenElse246 said, change the Anchor point to 0.5, 0.5
and set the Tween Position
to 0.5, 0 ,0.5, 0
.
I don’t want the GUI exactly in the middle. I only need the X axis to be in the middle because the Y axis works fine.
So change the X axis to 0.5
in Scale.
to do that, do anchor point = 0.5,0
and position = (what ever you want),(whatever you want),0.5,0
This is what I’m trying to do and it works in that scale but not when I put it to iPhone.
What position did you set it to tween to?
You can see the line of code I used in the original post.
The position you set is not in Scale but on Offset, it might be the problem.
Convert the Offset value to Scale.
I’ve used this line for every other GUI tween and it’s worked fine… Why not this 1 GUI?
Try to scale the UI again in Position using your plugin, and what is the AnchorPoint of the UI?
when i try to position ui’s i use the scale not the offset
Frame:TweenPosition(UDim2.new(1,0,1,0), "In", "Quad",.5,false)
if you position it at the offset then it will not work
I tried scaling it again with the plugin but it doesn’t change. The AnchorPoint is 0, 0
There might be a problem with the plugin, try to convert the Offset Position to Scale manually.
The solution for this article explains how to do that.
he can just by switching the x offset to the x scale same for the Y axis