For my game, I want to make it so that a triangle appears far away in a viewport frame on the center of the screen, and then flies closer in on the screen, shifting to the left side. To achieve this, I decided to change the scale of the viewport frame.
This worked, although it only did on only one screen resolution, as it’s offset on other resolutions are changed, which is not how I want it to be. What can I do to fix this?
The base size of the viewport frame is 1 for scale X & Y, 0 for both offsets.
for i = 1, 15 do task.wait(0.1)
triangleViewport.Size += UDim2.new(-0.05, 0, 0.02, 0)
print(triangleViewport.Size) -- (-0.05 * 15 = 0.75 | 1 - 0.75 = 0.25) , (0.02 * 15 = 0.3 | 1 + 0.3 = 1.3)
end
The viewport frame already covers the entire screen. I was also doing this before, someone recommended me to do what I am doing now, but disappeared off the post after I told them it wasn’t working.
It’s probably because this became more of a UI-Issue than a programming problem.
I think i know the Issue, it’s the ViewportFrame… the Object, doesn’t “stretch”, if you get what i mean… Basically, the Size of the Object will stay Consistent as a Box, like for example
If the ViewportFrame size is X=20 and Y=20
Then the Object size will obviously look “normal” or “even” as the ViewportFrame is a perfect box
But if the ViewportFrame size is X=30 and Y=20, the Object will still display as if it’s in a perfect box like X=30 Y=30
Basically, how the Objects are displayed in a ViewportFrame, cannot be stretched like an ImageLabel…