Help With Tweening

Hi I’m getting a weird problem when tweening CFrames. This is what it looks like:

function attack2(monster, target)
	local part = part2:Clone()
	local CF = CFrame.new(monster.HumanoidRootPart.Position, target.Character.HumanoidRootPart.Position)
	local endCF = CF * CFrame.new(0, 0, -20)
	part.CFrame = CF
	part.Parent = game.Workspace
	local tween = TweenService:Create(part, TweenInfo.new(2, Enum.EasingStyle.Linear), {CFrame = endCF})
	tween:Play()
	game:GetService("Debris"):AddItem(part, 1.8)
end

The blue sphere thing glitches out. Does anyone know why this happens? Is there something wrong with my code?

I’m stupid it wasn’t anchored :sweat_smile:

2 Likes