Viewport acting weird when parent frame is resized

ive been trying to make a character select menu, and when you click on a character it closes the whole frame, alike the domain screen flashes in jujutsu shenanigans, however when i shrink it instead of the viewportframe with a world model in it being clipped out as the rest of the frame closes, but because i use autoscale lite it prevents it from doing that, you can see when i change it back to the original way it would be on the size, it works, but it doesnt fit properly on the screen if i make it bigger

Trying making the viewportframe have offset size. Something like this:
{1,0,0, 300}

Use scale for the parent frame. Anchor the viewportframe to the center of the parent frame.

Anchor Point: .5, .5
Position: {.5,0,.5,0}

do i change the position of the frame to that position?

Here’s an example of what I’d do:
UI.rbxm (24.7 KB)


Mainly, have a viewport inside of a parent frame. The viewport size remains the same because it uses offset, not scale. ClipDescendants on the parent frame creates that effect that’s similar to JJS.

yes this works but if i put if i change the resolution of my screen/ change the size it does this


you can see it doesnt size right with the screen
is there a way to fix this?

im pretty sure im going to have to script some of this, so it works, ive loaded a imagelabel so it looks better but im most certain scripting is going to have to go into this to get a proper effect, ive done a little testing and tze seems to have the same issue, so im assuming theres no fix for it with just tweaking properites

1 Like

Whenever I use offset in my UIs, I usually use a UIScale parented under the ScreenGui to account for this.

I then dynamically adjust the UIScale.Scale property in game through code whenever the viewport size changes.

local UIScale = UI:WaitForChild("UIScale")
local Resolution = (1 / 720)

local SizeX, SizeY = self.Camera.ViewportSize.X, self.Camera.ViewportSize.Y

if (SizeY < SizeX )then
	UIScale.Scale = Resolution * SizeY
else
	UIScale.Scale = Resolution * SizeX
end
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.