i think this would need extremely complicated maths or im just not getting what algorithm you should use to do this kinda nonsense function
either way can you explain that better
I dont think going through all the pixels and going through their positions and their magnitudes then setting an average color would really help in optimization… Unless there is a holy grail of a roblox function that finds what frames are touching each other. Try researching for more info
If by pixel you mean a frame that is a size by {0, 10},{0, 10} or more then I could show u my script where I make my frames place beside each other else if the frame (pixel) is smaller then it will be harder to help with that since I am a bit lost of how you want the pixels places near each other. So like the other guy said maybe do some more researching.
Well this will get a bit complicated but I’ve had a coding like with this exact problem but one thing is that all your pixels are all positioned weird instead of being all nice and perfectly positioned
Here would be a script that you can use to detect if both pixels are touching
Make sure you loop threw all pixels except the yellow one in your Render
-- MainPixel = Yellow Pixel
-- Pixel = Any other pixel but the Yellow Pixel
local function HitDetection(MainPixel, Pixel)
local pos1, size1 = MainPixel.AbsolutePosition, MainPixel.AbsoluteSize;
local pos2, size2 = Pixel.AbsolutePosition, Pixel.AbsoluteSize;
local top = pos2.Y-pos1.Y
local bottom = pos2.Y+size2.Y-(pos1.Y+size1.Y)
local left = pos2.X-pos1.X
local right = pos2.X+size2.X-(pos1.X+size1.X)
if top > 0 then
-- Touched
elseif bottom < 0 then
-- Touched
end
if left > 0 then
-- Touched
elseif right < 0 then
-- Touched
end
end