Hi there. I am trying to make a Motor Door so when I click on a button, it opens the door like an animation.
Layout.
Front Door>Left Door>Union>Part>MotorA>BWeld How do I make Motor A work?
Hi there. I am trying to make a Motor Door so when I click on a button, it opens the door like an animation.
Layout.
Front Door>Left Door>Union>Part>MotorA>BWeld How do I make Motor A work?
I would recommend making the door a model and setting the primary part to an invisible part where the door will pivot from, then using the :SetPrimaryPatCFrame() function for the door model you can turn it smoothly.
local ldoor = workspace.LeftDoor; --This is the model in workspace that is your door
ldoor.PrimaryPart = workspace.LeftDoor.Hinge;
local originalPos = ldoor:GetPrimaryPartCFrame();
script.Parent.ClickDetector.MouseClick:connect(function()
for i=0, 90, 0.1 do
ldoor:SetPrimaryPartCFrame(CFrame.new(originalPos.x, originalPos.y, originalPos.z) * CFrame.Angles(0, math.rad(i), 0));
wait(0.1);
end;
end);
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
Sorry, I don't get you. But I will add you asa a friend on ROBLOX.
Do you not get how the script works?
no