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

What I have wrong in CFrame lerping?

Asked by
zeptak 4
6 years ago

I've done a script what is working but when I want to close the doors it will start bug. Its opening and closing both and I dont know how to handle with that. :/

01if d == false then
02        d=true
03        for i = 0,1,.00001 do
04            local cfm = workspace.SurfaceBlastDoor.PrimaryPart.CFrame:Lerp(finish,i)
05            workspace.SurfaceBlastDoor:SetPrimaryPartCFrame(cfm)
06            wait()
07        end
08    else
09        d=false
10        for i = 0,1,.00001 do
11            local cfm = workspace.SurfaceBlastDoor.PrimaryPart.CFrame:Lerp(starpos,i)
12            workspace.SurfaceBlastDoor:SetPrimaryPartCFrame(cfm)
13            wait()
14        end
15end
0
Please explain a bit more. do you mean it opens and closes the door at the same time? User#5423 17 — 6y

Answer this question