TweenService:Create failed because Instance is null

I don’t understand what this error means. I’ve never experienced ir before and it first occured when I used it in my disaster selector system for my destructive UFO. I’m not sure what could be causing this.

Relevant Code:

function UFO()
	local goal = {}
	local ToDestroy = {}
	local clone = game.ServerStorage.Disasters.UFO:Clone()
	clone.Parent = workspace
	local tweenInfo = TweenInfo.new(3, Enum.EasingStyle.Quad, Enum.EasingDirection.In, 1, false, 0)
	for i = 1, 9, 1 do
		table.insert(ToDestroy, #ToDestroy+1, SelectTile())
	end
	for i, v in pairs(ToDestroy) do
		goal.Position = Vector3.new(v.Position + Vector3.new(0,7,0))
		local tween =TweenService:Create(clone.PrimaryPart, tweenInfo, goal)
		clone.PrimaryPart.Anchored = false
		tween:Play()
		local Explosion = Instance.new("Explosion", v)
		Explosion.Position = v.Position
		wait(3)
		v:Destroy()
		clone:Destroy()
	end
end

You are destroying clone after the first loop iteration. On the second iteration clone = nil.

4 Likes