Help with Popup UI

Hello everyone, i need help with a Popup UI script that i’ve been having issues with.
The issue is that whenever it opens up the outline only shows up for it but not the actual UI i’m using a CanvasGroup for this.

Heres the code i’m using for this (ModuleScript)

local Module = {}

local TweenService = game:GetService('TweenService')
local FrameSpeed = 1

local Styles = {
	OpenEasingStyle = Enum.EasingStyle.Back,
	OpenEasingDirection = Enum.EasingDirection.In,
}

function Module.Open(Frame, OffsetSizeX, OffsetSizeY)
	if Frame then
		Frame.Size = UDim2.new(0,0,0,0)
		
		local Opening = TweenService:Create(Frame, TweenInfo.new(FrameSpeed, Styles.OpenEasingStyle, Styles.OpenEasingDirection), {Size = UDim2.fromOffset(OffsetSizeX, OffsetSizeY)})
		Opening:Play()
	end
end

function Module.Close(Frame)
	if Frame then
		local Closing = TweenService:Create(Frame, TweenInfo.new(FrameSpeed, Styles.OpenEasingStyle, Styles.OpenEasingDirection), {Size = UDim2.fromOffset(0,0)})
		Closing:Play()
	end
end


return Module

And heres what it shows up

1 Like

What its supposed to show:

Are your frame elements parented to the frame you are moving?

Yes the issue is that the whole background even the frame gets hidden just the outline shows.

Have you checked the transparencies/visibility?
To prevent awkward resizing effects I set the children to 1/false until the tween has finished. Thought you might do something similar?

Constantly changing the size of a CanvasGroup forces it to redraw it’s texture repeatedly, which causes it to reach a memory limit and render completely blank. You can read more about it here.

If you don’t need the CanvasGroup’s GroupColor3 and GroupTransparency, just use a regular Frame.

Howeveri if you need those; I’d recommend hiding the CanvasGroup and creating a Frame identical to the CanvasGroup and have it visible during the animation, then hide it and show the CanvasGroup after the animation is finished. This way, you can keep both the animation and the CanvasGroup without any blank frames. (CanvasGroups do not use any memory when they are scaled while they have their Visible property set to false)

3 Likes

Thank you for this i will try making it a Frame now, i only wanted to make it a CanvasGroup for the grouptransparency but i guess i can just code it to work with Frame :slight_smile:

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