So I’m working on a mini-project where it makes a line of dominos and It knocks it over. However, when attempting to make a turn, I realize it won’t move forward in the direction it’s facing. Easy, just add a LookVector and move on. Well, apparently not, because it turn my code into a giant mess of whenever to use Vector3 or Cframe. Its madness and I need help organizing this.
My Full Code
local Original = game.Workspace.Part
CurrentPosition = Original.Position
CurrentOrientation = Original.Orientation
wait(3)
for count = 1, 10, 1 do
local Copy = Original:Clone()
CurrentPosition = CurrentPosition + Vector3.new(0,0,4)
Copy.Position = CurrentPosition
Copy.Parent = game.Workspace
end
wait(3)
for count = 1, 5, 1 do
local Copy = Original:Clone()
CurrentOrientation = CurrentOrientation + CFrame.Angles(0, math.rad(36), 0)
CurrentPosition = CurrentPosition + Original.CFrame.LookVector * 2
Copy.Position = CurrentPosition
Copy.Orientation = CurrentOrientation
Copy.Parent = game.Workspace
print(Copy.Position)
end
wait(3)
Original.Orientation = CFrame.Angles(0, 0, math.rad(-10))
Well, keep in mind that I’m cloning the original domino, so the height and color don’t need to be changed. They’re also dominos, so they need to be unanchored in order to tip over.
I understand the code up until the curve part: