I want to make my brick floating side way by using C-frame. I tried and it doesn't work, how come?
local Part = script.Parent local PartPost = CFrame (0,10,0) local PartPos = Part.CFrame.y local MaxHeight = PartPos + 10 local LowestHeight = PartPos - 0 while wait() do for Y = PartPos, MaxHeight, .05 do Part.CFrame = CFrame.new(Part.CFrame.x, Y, Part.CFrame.z) wait(.05) end local PartPos = Part.CFrame.y for Y = PartPos, LowestHeight, -.05 do Part.CFrame = CFrame.new(Part.CFrame.x, Y, Part.CFrame.z) wait(.05) end local PartPos = Part.CFrame.y end
You are right now taking the Y position of the Part, but you should actually use the X or the Z position, as Y = Height, X = Length and Z = Depth. Try replacing PartPos from Part.CFrame.y into Part.CFrame.x or Part.CFrame.z. Hope this helped