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

Moving Platform Bug?

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.

2 answers

✓ Accepted answer

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)

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