so my perlin noise dance floor works, but its moving like 50 studs below where its supposed to be and i have no clue why. heres my script and heres a gyazo of what its doing, any help?
local TweenService = game:GetService("TweenService")
local connection
local sound = game.Workspace:WaitForChild("GlobalMusic")
local floor = game.Workspace:WaitForChild("floor")
local info = TweenInfo.new(1, Enum.EasingStyle.Back, Enum.EasingDirection.InOut);
local TotalParts = 0
local Finished = 0
local CanGo = true
connection = game:GetService('RunService').Heartbeat:Connect(function()
local loudness = sound.PlaybackLoudness/500 --make this super low since noise is kind of sensitive
TotalParts = #floor:GetChildren()
if Finished >= TotalParts then
CanGo = true
Finished = 0
end
if CanGo then
CanGo = false
for _,part in pairs(floor:GetChildren()) do --for every block in the floor
local noise = math.noise((part.Position.X/75)+loudness,(part.Position.Z/75)+loudness,sound.TimePosition) --change "50" to make it look different
--part.Position = Vector3.new(part.Position.X,noise*20,part.Position.Z) --unless the blocks have a default Y position of zero you might want to add a certain amount to (noise*4)
spawn(function()
local FloorTween = TweenService:Create(part, info, {
Position = Vector3.new(part.Position.X,noise*4,part.Position.Z)
})
FloorTween:Play()
FloorTween.Completed:Wait()
Finished += 1
end)
end
end
end)