Hello. I am trying to make a “quick-search” system.
In this color picker, players can select a color by pressing one of the many colored buttons. If they scroll away, I want them to be able to click
this:
and have the scrolling frame automatically scroll to the selected buttons position.
Here is the code I currently have. (Everything works in the code except getting the position of the identified button.)
function load()
local list = script.Parent.Parent.Parent.colors
local selection = script.Parent.Parent.Text
local s = list:FindFirstChild(selection)
print(selection,s.Name,s.Position.X.Offset)
if s then
local xpos = s.Position.X.Offset
list.CanvasPosition = Vector2.new(xpos,0)
end
end
script.Parent.MouseButton1Up:Connect(load)
I have already found the problem. I am using UIListLayout, which completely disables the position property of the GUI object inside of the scrolling frame.
Now, I need to figure out another solution that will let me get the position of the GUI inside of the scrollingframes canvas.