Been working on a small project and encountered a troublesome bug. Since I’m not a big fan of Welds & WeldConstraints I decided to use them in this particular project for some actions.
I have a model with 4 parts. a base and 3 outlines
The outlines are welded to the base part and I am trying to make a moving part on-click using the script
local Click = script.Parent.ClickDetector
local PMAIN = script.Parent.Main
local P1 = script.Parent[“1”]
local P2 = script.Parent[“2”]
local P3 = script.Parent[“3”]local function OnClick(Player)
P1.CanCollide = false
P2.CanCollide = false
P3.CanCollide = false
PMAIN.CanCollide = falsefor trnaPM = -191.57,-188.57,0.1 do
script.Parent.Main.CFrame = CFrame.new(PMAIN.Position.X, PMAIN.Position.Y, trnaPM)
wait(0.005)
endscript.Parent.ClickDetector:Destroy()
endClick.MouseClick:connect(OnClick)
I usually do not use Welds or WeldConstraint at-all so I’m not really sure on how to exactly place them (I just used logic)
The rooting goes like this:
I’d assume the welds are correct since I’ve tested moving the part in various ways and they leached onto the base part.
But when running the script in testing & clicking this happens:
I have tried using Vector3 instead of CFrame but that just detects collision and makes the part go on top of the build.
I have also tried messing with anchors and such but then the part just falls and that beats the point…
Was wondering maybe either my script is a mess or my welding is, would appreciate any help I could get, maybe even a different method to move the part.
If anyone is interested in watching that from up close you can go here : The Reckoning - Roblox
Walk the path, enter the cave, and click the loose part near the windows.