DragDetector Not Working when Camera is not on Player

Hello DevFourm, I’m not sure if this should work but here’s my problem:

So I am making a Part Editor in my game where you can edit and spawn your parts that you have created with this Part Editor. I want to make a feature where you can drag the part to rotate it around. I figured out that DragDetectors have a “RotateTrackBall” drag style, so I tried adding one to the editor’s part. However, when in the editor, the DragDetector does not work.

Heres a video to better explain the problem:

The camera CFrame changes to the “Cam” parts CFrame in the workspace. For some reason the DragDetector IS ENABLED but doesn’t do anything.

here is the function that Creates the DragDetector:

function createPart(plr)
	local part = Instance.new("Part")
	--local music = editorMusic[math.random(1, #editorMusic)]
	part.Material = Enum.Material.SmoothPlastic
	part.Parent = workspace.CurrentPart
	part.Anchored = true
	part.Position = partPos.Position
	
	local dragDect = Instance.new("DragDetector")
	dragDect.Parent = part
	dragDect.DragStyle = Enum.DragDetectorDragStyle.RotateTrackball
	
	eventOpen:FireClient(plr)
end

I know this might be a simple fix but thank you :slight_smile:

Increase the MaxActivationDistance like a ProximityPrompt

The reason this happends is cus the DragDetector checks if the players CHARACTER is in range, not the players camera.

I have tried that, it doesn’t work.

Okay, ill try to move the players character closer to the part.

EDIT: It worked :slight_smile: thank you

happy that it worked, quick question, did you try setting the MaxActivationDistance to inf instead of moving the player?

MaxActivationDistance = math.huge

Oh, no I haven’t. I’ll try that out.

EDIT: It worked! Thanks again! :slight_smile:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.