|
| 22 Nov 2012 01:11 PM |
action = 1 A = script.Parent.Parent.Door.Position.X B = script.Parent.Parent.Door.Position.Y C = script.Parent.Parent.Door.Position.Z D = 0
function onClicked(playerWhoClicked) if action == 1 then action = 3 for i = 1, 20 do D = D + .005 script.Parent.Parent.Door.CFrame = CFrame.new(A, B, C) * CFrame.Angles(0, D, 0) wait(.1) end wait(5)
for i = 1, 20 do D = D - .005 script.Parent.Parent.Door.CFrame = CFrame.new(A, B, C) * CFrame.Angles(0, D, 0) wait(.1) end
action = 1
end end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
That all rotates 1 brick (Yes I know I use to much white space). I wanted to build a door that swung outwards so I made that. How can I attach other bricks to that and make them rotate with that brick? Manuel welds didn't work, welded surfaces didn't work .... I don't quite know what to use ... |
|
|
| Report Abuse |
|
|
|
| 22 Nov 2012 01:13 PM |
What you're asking for is fairly difficult... you could accomplish it with concepts such as object/world coordinates, matrix math, or trigonometry. Those are all fairly high-level concepts.
¬ SHG Scripter Tier-2 ♣ LuaLearners Elite |
|
|
| Report Abuse |
|
|
|
| 22 Nov 2012 01:16 PM |
| That was my guess. I'm only in precalc, trig is a bit ahead of me. :P I was just hoping there was a special weld I didn't know about that magically solved all my problems. |
|
|
| Report Abuse |
|
|
|
| 22 Nov 2012 01:17 PM |
:\ yeah we all could wish for something like that.
¬ SHG Scripter Tier-2 ♣ LuaLearners Elite |
|
|
| Report Abuse |
|
|
|
| 22 Nov 2012 01:19 PM |
| I'll just stick to making one brick go up/down, left/right, forward/backwards. |
|
|
| Report Abuse |
|
|