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

PrimaryPartCFrame not working?

I made a button that moves a model when it is clicked. The script is eternally simple and I can't understand why it isn't working. I get the error Unable to cast double to CoordinateFrame Here is the script:

script.Parent.ClickDetector.MouseClick:connect(function()
	script.Parent.Parent:SetPrimaryPartCFrame(10,0,10)
end)

Help please.

1 answer

✓ Accepted answer

You made a simple mistake. You tossed in 10,0,10 but you need it to be CFrame.new(10,0,10).

SetPrimaryPartCFrame needs two things. First you MUST have a PrimaryPart for the model before you try to use SetPrimaryPartCFrame and also, in the parenthesis, you need a CFrame value!

2 comments

0

Thanks, totally forgot about the CFrame.new!

0

No problem, I do mistakes similar to that, here and there.

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