#dragPart not causing the tween to happen

1 messages · Page 1 of 1 (latest)

night plume
#
local dragpart = workspace.Filter.DragTask
local unlock = script.Parent
local TS = game:GetService("TweenService")
local isAnim = false
local debounce = false

local ray = workspace:Raycast(dragpart.Position, dragpart.CFrame.upVector * -150)
if ray then
    if ray.Instance.Name == "unlock" and not debounce then
        debounce = true
        local tween = TS:Create(unlock, TweenInfo.new(1, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {Position = Vector3.new(-47, 0.579, 14)})
        tween:Play()
        tween.Completed:Wait()
        debounce = false
    else
        if debounce == true then
            local tween = TS:Create(unlock, TweenInfo.new(1, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {Position = Vector3.new(-47, 1.281, 14)})
            tween:Play()
            tween.Completed:Wait()
            debounce = false
        end
    end
end
#

the dragpart moves to where the mouse is and when you drag it onto the unlockPart, it should start the tween and let it go down, then go back up once the dragpart is removed, this doesnt allow it at all