Part disappears after 0.5-1 second

clonesActive = clonesActive + 1
PTC:FireServer(clonesActive)
local keyVisualPart = Instance.new("Part")
keyVisualPart.Name = "KeyVisualPart"
keyVisualPart.Size = Vector3.new(1, 1, 1)
keyVisualPart.Transparency = 1
keyVisualPart.Anchored = true
keyVisualPart.CanCollide = false
keyVisualPart.CFrame = character.HumanoidRootPart.CFrame * CFrame.new(0, 0, -2)
keyVisualPart.Parent = workspace
game.Debris:AddItem(keyVisualPart, 0.5)
local billboardGui = Instance.new("BillboardGui")
billboardGui.Size = UDim2.new(0, 50, 0, 50)
billboardGui.AlwaysOnTop = true
billboardGui.Parent = keyVisualPart
local textLabel = Instance.new("TextLabel")
textLabel.Text = clonesActive
textLabel.Size = UDim2.new(0, 50, 0, 50)
textLabel.Parent = billboardGui

nowhere in the script is this part messed with other than these lines

might be “game.Debris:AddItem(keyVisualPart, 0.5)”

Its deftintly the line with the game.debris.

heres your issue

its this, debris:additem() is pretty much just object:destroy() but with a timer,

also, another little gripe

It’s better practice to set an instance.new or a object:clone() object’s parent before changing its properties nvm

another small thing

change this to clonesActive += 1, what you have works but its cleaner to use the addition assignment

Actually, it’s always best practice with performance to set the Parent of a new instance LAST, after setting all properties. Read here. Obviously, my sentiment is not the case with Cloned objects, since they will be cloned and will retain the parent property, but definitely with Instance.new() objects.

definitely not making past 0.5 :broken_heart:

I sure do wonder why it disappears after 0.5 seconds

oh wait really? damn thats my bad