Jigsaw Puzzle Creation Help!

Hi! I’m creating a jigsaw puzzle game. I’m a beginner programmer. My goals:

Using the drag detector

  • Snap an object into place. Example: Jigsaw piece snaps into place when the object hovers over the correct location.
  • Click to rotate object by 90 deg
  • Disabling drag detector for players outside of team. So others not in your team can’t mess with your puzzle.

For rotating the object by 90 deg, I have a script but it only works on a part in workspace, and with no drag detector… There are no errors except a warning for infinite yield for “Plane”. The puzzle itself is a model with all the pieces as separate objects; It’s stored in replicated storage and gets generated with a separate script.

local part = game.Workspace:WaitForChild("Plane")
local clickDetector = game.Workspace:WaitForChild("DragDetector")

local function onClicked(player)
	part.Rotation = CFrame.new(0, 90, 0)
end


part.MouseClick:Connect(onClicked)

Regarding snapping pieces into place, there are no resources for this specific scenario. I know there are guides for object snapping to grids like a placement system, but I just need it to snap where the piece is supposed to be, nowhere else. Otherwise it is free to drag.

I’m not sure how to go about disabling drag detector for player outside of specified team. I have a script that creates a team, but that’s all it does.

The drag detector is fairly new so there are not many resources for niche scenarios like this. Thank you :slight_smile:

1 Like

This means that the part does not exist in the workspace.

Oh that makes sense now, thank you! I’ve been using FindFirstChild instead and there hasn’t been an error.

1 Like