How to make frames in UIGridLayout fit exactly in a scrolling frame

Hi, I want to fit frames exactly into a scrolling frame. Right now I have a scrolling frame with a massive canvas size of UDim2.new(0,0,50,0) with a UIGridLayout of CellPadding = UDim2.new({0.05, 0},{0.002, 0}}, CellSize = UDim2.new({0.29, 0},{0.008, 0}}, it is very inefficient and I want to know how to make all the frames fit exactly in the frame

This is the game:
https://www.roblox.com/games/7110163297/TITLES-Super-Sabers

Btw I am talking about the main pet frame