Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I animate my Double Doors? SOLVED.

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?

1 answer

✓ Accepted answer

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);

3 comments

0

Sorry, I don't get you. But I will add you asa a friend on ROBLOX.

0

Do you not get how the script works?

0

no

This discussion is preserved as it was. New answers, comments, and votes are closed.