So I basically an using a method of clicking a part to move it forward by 5 studs. So I make the script, but it says there is something wrong. I can't figure it out. Here is the script
Part = script.Parent function move() Part.CFrame = Garrett.CFrame * Vector3.new(0,0,5) end Part.ClickDetector.MouseClick:connect(move)
The Script and Click detector is set inside the part.
Vector3
cannot multiply with CFrame
.
Part = script.Parent function move() Part.CFrame = Garrett.CFrame * CFrame.new(0,0,5) end Part.ClickDetector.MouseClick:connect(move)
So basically I have found the answer to the script. I cannot multiply Vector3 with CFrame, but I can add it.
Part = script.Parent function move() Part.CFrame = Part.CFrame + Vector3.new(0,0,5) end Part.ClickDetector.MouseClick:connect(move)