I am attempting to make a part dragging script using the AlignPosition constraint. When dragging the part, you can see in the video I’ve included that the constraint moves to the desired position, but the part does not follow immediately, rather it has a delay.
Video here:
I’ve attempted to adjust the settings for the constraint, such as MaxForce and Responsiveness, but it does not change the issue.
Here is a snippet of the code that deals with the constraint and mouse movement:
for i, value in pairs(partsFolder:GetChildren()) do
if down == true and target == value then
currentTarget = value
alignPos = value.AlignPosition
alignPos.Enabled = true
targetPos = head.Position + (mouse.Hit.Position - head.Position).Unit * dist
alignPos.Position = Vector3.new(targetPos.X, targetPos.Y, targetPos.Z)
I would appreciate any help with this, whether it is an issue with my scripting or the properties of the constraint.