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
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)
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