Literally how? I don't understand how Club Sanity, Club Insanity did this dancefloor?

Okay so I’m legit trying to hire people for 40 USD to exactly recreate club insanity/Club sanity’s dancefloor and everyone keeps renaming parts, or not making it look smooth or using parts and I want everything just like how it is in this picture regardless.

So how would I do the sliding function that club insanity/club sanity had where the dancefloor like slides by in rows changing the white to the color and so on then goes back here’s examples.

https://gyazo.com/effe76b2f390d2c9ac4a87da40c0ac7b
https://gyazo.com/bbcce70ff9f4b24f733a0519555a5f1f
https://gyazo.com/90f77acb592820e56530a679348d5372
https://gyazo.com/1e4fb33aa335bf175179a64a836988ea

I legit don’t get it. HOW DID THEY DO THIS?! I want it exactly like club insanity’s dancefloor.

1 Like

They probably just had a Sequence of Data for the Code to loop through, Applied it to the Parts under a specific order, and then Made it Disapear using Interpolation, or commonly known as Lerp.
If not then its most likely using a for loop and changing the Transparency based on Incrementation (However that is also how Lerp functions so ¯\_(ツ)_/¯ )

I don’t even know those words…

Every row of squares is parented inside a model, then a for loop goes through the models with a little delay (e.g. 0.1) and makes their Transparency 1. This is really easy to do.

Yeah but how do they do the rows?

Take 1 row of squares, group them into a model. Then do that for every other row.

They group all the parts in a row. Then they iterate like this:

for rowid = 1, #rows:GetChildren() do
    local row = rows["Row"..rowid]
    for _, part in pairs(row:GetChildren()) do
        part.Color = currentColor -- set row color here
    end
    task.wait(0.05)
end

They didn’t group anything tho they had all the textlabels in frame and just had the scripts

They got the rows via the positioning of the tiles. From there they sorted them into rows and did what @blueberry said.

So how would I exactly do this I have made it work using absoluteposition

I happen to have a similar dancefloor. I found this within the code which creates a grid. You can copy that and turn y into rows and x into columns.

for y = 0, 9 do
    for x = 0, 9 do
      local s = slot:Clone() -- slot is just a frame
      s.Position = UDim2.new(x * 0.1, 0, y * 0.1, 0)
      s.Parent = squares
    end
    wait()
end

With this in mind we can use it to “reverse engineer” and figure out the opposite. They did 0, 9 which can be confusing so we’ll change it to 1, 10. I will also change the variable from ‘s’ to ‘Frame’.

local Slot = script:WaitForChild('Slot')
local MainFrame = script.Parent:WaitForChild('MainFrame')
for y = 1, 10 do -- Creates grid
	for x = 1, 10 do
		local Frame = Slot:Clone()
		Frame.Position = UDim2.new(x * 0.1, 0, y * 0.1, 0)
		Frame.Name = y .. "_" .. x
		Frame.Parent = MainFrame
	end
	task.wait()
end

We named them so now we go something like 1_1, 1_2, 1_3, etc. Based off of y and x axis. Using this info we can then make a table.

local Slot = script:WaitForChild('Slot')
local MainFrame = script.Parent:WaitForChild('MainFrame')

local rows = {}
local columns = {}

for y = 1, 10 do
	rows[y] = {}
	for x = 1, 10 do
		local Frame = Slot:Clone()
		Frame.Position = UDim2.new(x * 0.1, 0, y * 0.1, 0)
		Frame.Name = y .. "_" .. x
		Frame.Parent = MainFrame

		rows[y][x] = Frame

		if not columns[x] then
			columns[x] = {}
		end
		columns[x][y] = Frame

	end
	task.wait()
end

Now that you have the tables you SHOULD be able to make patterns with the following information. Hope this helps :>

I’ve made a dance floor in the past actually. Here’s a clip of the dance floor in action.

If the image doesn’t show, here’s the link to the gif
Dance Floor Gif

As you can see it’s almost like what you want. And it’s completely UI based, and runs perfectly fine on a very code heavy game.

If you want me to help you out reach out, and I can take you through the steps.

I have a dancefloor of my own as well. Although I am not sure how to do the wave / slide effect. I had it semi-working but it didn’t like to do the effect in ‘reverse’ even though I scripted it to go either way. I have a lot to work on in my game. I hired a co-scripter so that’s cool. You can find videos on older versions of my dancefloor on my yt (my username) if you guys are curious.

Yeah it’s a bit tricky but all I did to get mine to do the sliding wave, was just name every tile in a row A# where # is the tile number in that row. (A1, A2, A3…) Then I do that for each row with the next letter. B1, B2, B3, etc. Then all I do it loop through the alphabet and get any tile starting with that letter. This worked well for me.

let me know if this doesn’t make sense

Yeah that’s pretty much what I did but for what ever reason it wasn’t actually making the rows behind the current row transparent.

For that you’d need to use a coroutine, which allows you to have each row function on it’s own without delays.

This allows you to individually control the rows/columns.

for i,v in pairs(Rows) do
   coroutine.wrap(function()
      --the code for each row
      for _,tile(v:GetChildren()) do
         --do whatever with each tile. set the color, etc.
      end
      task.wait(0.5) --Or whatever you want
      for _,tile(v:GetChildren()) do
         --set the tile to black or off.
      end
   end)()
end

This will loop through each row, and control it separately from the other rows without causing the other rows to wait for the previous row’s function to finish.

Give this a shot!

Will it cause lag or no? Also, I did get this working in my game but it’s lagging, how do I fix that.

I’m using absoluteposition btw

How is that causing lag? :sob: Also why are you using absoluteposition?

Because absolute position did what I needed it to do?

Also with your method I can keep everything named TextLabel, right?