Help with AlignPosition not wanting to move

Attempting at using AlignPosition to move stuff but when I try to move a BasePart with a MeshPart and a WeldConstraint, it just doesn’t move.


image

local raycastParams = RaycastParams.new()
raycastParams.FilterDescendantsInstances = {game.Players.LocalPlayer.Character}

function hoveringOverItem()
	local mouseLocation = UserInputService:GetMouseLocation()
	
	local origin = workspace.CurrentCamera.CFrame.Position
	
	local ray = workspace:Raycast(origin, workspace.CurrentCamera.CFrame.LookVector * 10, raycastParams)
	if ray then
		if ray.Instance.Parent.Name == 'Plate' or ray.Instance.Parent.Parent.Name == 'Plate' then 
			return true, ray.Instance:FindFirstAncestor('Plate')
		end
		if ray.Instance.Parent.Name == 'Cheese' then
			print('Cheese???')
			return true, ray.Instance.Parent
		end
		
		return true, ray.Instance
	end
end
local function press(input, gpa)
	if gpa then return end
	if input.UserInputType ~= Enum.UserInputType.MouseButton1 then return end
	if renderSteppedConnection ~= nil then return end
	
	local hovering, instance = hoveringOverItem()
	if hovering and not instance:FindFirstChild('CarriedBy') and instance:FindFirstAncestor('Items') then
		carryControls.Visible = true
		doorControls.Visible = false
		grillProgress.Visible = false
		
		carrying = instance
		print(carrying)
		
		alignPosition = script.AlignPosition:Clone()
		alignPosition.Attachment0 = carrying:FindFirstChild('Attachment')
		alignPosition.Parent = carrying
		
		alignOrientation = script.AlignOrientation:Clone()
		alignOrientation.Attachment0 = carrying:FindFirstChild('Attachment')
		alignOrientation.Parent = carrying
		
		highlight = Instance.new('Highlight')
		highlight.FillTransparency = 1
		highlight.OutlineColor = Color3.new(0, 0, 0)
		highlight.OutlineTransparency = 0
		highlight.Adornee = carrying
		highlight.DepthMode = Enum.HighlightDepthMode.Occluded
		highlight.Parent = carrying
		
		if carrying:FindFirstChild('Mesh') then
			highlight.Adornee = carrying:FindFirstChild('Mesh')
		end
		
		-- carrying.CanCollide = false
		
		carryRemote:FireServer(instance)
		renderSteppedConnection = game:GetService('RunService').RenderStepped:Connect(function()
			local position, normal = raycast()
			alignOrientation.CFrame *= CFrame.Angles(math.rad(vertical*5), math.rad(horizontal*5), 0)
			if normal then
				alignPosition.Position = position + (normal * (instance.Size / 2))
			else
				alignPosition.Position = position
			end
		end)
		
		if renderSteppedDoorConnection ~= nil then
			renderSteppedDoorConnection:Disconnect()
			renderSteppedDoorConnection = nil
		end
		if renderSteppedProgressConnection ~= nil then
			renderSteppedProgressConnection:Disconnect()
			renderSteppedProgressConnection = nil
		end
	end
end
1 Like

Is the mesh part unanchored? and u welded chesse with mesh or somthing else?

Not anchored, only welded to cheese

Looks like some part is anchored or its welded to something that is anchored. Also u can try change Mesh to Special mesh (it dont require weld)

I want the basepart to collide with stuff, but the meshpart to not, for accurate stacking

image
Here’s why I don’t use SpecialMeshes

1 Like

Hage size of part to math mesh size

1 Like

That didn’t seem to work, any other solution?

1 Like