Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How Come My C-Frame Doesn't Work?

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

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.