The Console tells me that it changes, but I don’t see a difference. May it be caused by my UI Constraint?
The TweenSize works in Studio, so why wouldn’t it IN GAME?
hmm, can you show an example? I dont quite understand what you mean by that.
You want me to UDim2.new() and multiplicate the Offset (which is 0) by a number?
Okay, I set the TextButton BackgroundTransparency to 0. So this is what it gives me. I have a UI Constraint and a UI Stroke inside the TextButton. Yes, the X is Text and Yes, I already set it Scaled = true
There’s a good chance that some sort of UI constraint is preventing your UI from re-sizing, l
There’s also a chance :TweenSize() and :TweenPosition() are acting up.
This post reports issues when select EasingStyles are used with :TweenSize() and :TweenPosition().
The general idea I get from reading posts on the developer forum is that Roblox doesn’t care about these functions anymore and would prefer developers use TweenService.
For ease of use, use a function like this,
local TweenService = game:GetService("TweenService")
local TweenInfo1 = TweenInfo.new(20, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0)
local function Tween(Object, Info, Target, WaitToFinish)
local NewTween = TweenService:Create(Object, Info, Target)
NewTween:Play()
if WaitToFinish then
NewTween.Completed:Wait()
end
NewTween:Destroy()
NewTween = nil
end
So I have to make a TweenService:Create() with TweenService and set the Target to my UDim2.new values and it should work? TweenService does work with GuiObjects right?
Okay, I found out if I set my AnchorPoint to (0, 0). The Animation actually works, but it doesnt scale it like “centered”. It makes it smaller, but it goes like towards a direction, its not like the button becomes smaller in the middle. Is there a way to fix that?
Yes, there is no UI Constraint preventing me. I tried removing it and it still doesn’t work. I also did the animation using your TweenService method instead
Enable the TextScaled property inside the TextButton.
If the scaling doesn’t work as you’d like, use the TextBounds property and size properties inside the TextButton to figure out how much space the text is taking up and how you want to scale it to fit within the box.
If you are picking the second route, make sure TextWrapped in the TextButton is disabled.
In Studio, if we closed every tab and pressed the arrow next to “What’s new”, we could see that the size doesn’t change (from what we can see).
FIX:
Basically all I needed to do is increase of the multiplication for the UDim2.new(). The change was so small that we couldn’t see it (Our eyes weren’t capable to see the difference).