Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i connect click detectors with primary part cframe?

Asked by 2 years ago

I am trying to animate a model with cframe using setprimary part and I have no idea how to connect the script with clickdetectors.

1 answer

Log in to vote
0
Answered by 2 years ago

I'm not great at this sort of thing, but, you could try something along the lines of:

script.Parent.ClickDetector.MouseClick:Connect(function()
local modelname = game.Workspace:FindFirstChild("INSERTNAMEHERE")
local pos = modelname.PrimaryPart.CFrame = CFrame.new(0, 0, 0) --insert position here
modelname:SetPrimaryPartCFrame(pos) --sets the position stated in variable pos
end)

I'm not sure wether this is what you where looking for, would be helpful if you attached the script that you currently have.

Ad

Answer this question