Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How Come My C-Frame Doesn't Work?

Asked by
ImfaoXD 158
8 years ago

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

Log in to vote
0
Answered by
sigve10 94
8 years ago

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

Ad

Answer this question