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

Moving platform gets stuck in place?

Asked by 2 years ago

heres the code

local y = script.Parent.CFrame.Y
local part = script.Parent
local button = workspace.Button2.button2.scriptpart2
local e = 1
button.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild('Humanoid') then
        repeat wait() until button.Touched 
            while true do

                part.CFrame = CFrame.new(36, y + 0.05 * e, -36)
            wait(0.05)
            print("height is" and y)
            print(script.Parent.CFrame.Y)
            if y > 20 or y < 3 then 
                print('We have triggered')
                    e = e * -1
                    wait(3)
                end

            end
        end
    end
)
0
Try using BodyPositions MattVSNNL 620 — 2y
0
But in this case turn off cancollide MattVSNNL 620 — 2y

Answer this question