How do I lerp multiple parts, in a model. I don’t know how, just need it so go sideways slowly.
local LaunchButton = script.Parent.Click
local Missle = game.Workspace.Missle
local MissleFire = game.Workspace.Missle.Flame.Fire
local MissleSmoke = game.Workspace.Missle.Flame.Smoke
local AfterSmoke = game.Workspace.AfterSmoke.Smoke
local Platform = game.Workspace.Hatch
local Player = game.Players.LocalPlayer
local current = os.clock()
LaunchButton.MouseClick:Connect(function()
if os.clock() >= current then
current = os.clock() + 500
print("Timer Set")
Platform:SetPrimaryPartCFrame(CFrame.new(-9.953, 1.144, -25.625))
wait(15)
Platform:SetPrimaryPartCFrame(CFrame.new(-18.741, 1.144, -25.625))
end
end)
My last post was different so I deleted it anyways here’s the code:
LaunchButton.MouseClick:Connect(function()
if os.clock() >= current then
current = os.clock() + 500
print("Timer Set")
Platform:SetPrimaryPartCFrame(CFrame.new(-9.953, 1.144, -25.625))
wait(1)
Platform:SetPrimaryPartCFrame(Platform:GetPrimaryPartCFrame():Lerp((CFrame.new(-18.741, 1.144, -25.625),15))
end
end)
I can’t write out the code for you, but here’s an idea.
You can use tween service for this. Use tween service on a cframe value object, run the tween, and listen to the property changed signal. The cframe value is being tweened, but you can transfer this to the model. As the cframe object is changed, just update the model’s cframe to match what the cframe value object is. Make sure the value of the cframe value object is set to the cframe of the door first, presumably the primary part, before you run the tween.
for i = 0 , 1, 0.0001 do
wait()
Platform.PrimaryPart.CFrame = Platform.PrimaryPart.CFrame:Lerp(CFrame.new(-9.953, 1.144, -25.625), i)
end
for i = 0 , 1, 0.1 do
wait()
Missle.PrimaryPart.CFrame = Missle.PrimaryPart.CFrame:Lerp(CFrame.new(-18.642, 743.625, -25.868), i)
end
end