Question about weld and movement

Hello, I’m having some troubles with a weld and how it moves.
Here you can see the structure of my inspector:
image

The DetectingZone is a cylinder that moves between paths using tweenService.
Inside I have a mesh and a spotlight and I want them to follow the DetectingZone, I think the best option was to create a weld so they will be attached and follow this part, but they stay static in the scene without moving and I see how the cylinder move.
What’s wrong with this? Maybe i need to do it different way?

1 Like

Tween the .CFrame property and not .Position. using the .Position property will ignore the weld and position only that part.

When I tried to get the .CFrame of the part i got this error:

TweenService:Create property named 'PrimaryPart' cannot be tweened due to type 
mismatch (property is a 'Object', but given type is 'Dictionary')

The code I got was this one:

local function moveModelToPosition(position)
    local tweenInfo = TweenInfo.new(moveDuration, Enum.EasingStyle.Linear)
    local targetPosition = position

    local primaryPart = vigilanceFocus.PrimaryPart
    local initialPosition = primaryPart.Position

    local distance = (initialPosition - targetPosition).Magnitude

    local tween = game:GetService("TweenService"):Create(vigilanceFocus, tweenInfo, {PrimaryPart = {CFrame = CFrame.new(targetPosition)}})
    tween:Play()

    tween.Completed:Connect(function()
        local finalDistance = (vigilanceFocus.PrimaryPart.Position - targetPosition).Magnitude
        if finalDistance > marginError then
            print("Error")
        end

        currentIndex = currentIndex % totalPositions + 1
        position = positions[currentIndex]
        moveModelToPosition(position)
    end)
end

No need to do this for your goal property table with PrimaryPart =, try looking at other posts or how to tween CFrame.