TweenBase Completed not firing?

For some reason, my function that checks when a tween completes doesn’t work.
Normally, it does work. However, it breaks whenever anything is below the “missile1tween:Play”. Even just a “wait(2)” will break it. However, the second tween works just fine. I’m not sure what’s going on. The tween itself plays just fine, it just won’t fire that it’s completed, even though it completes.
Here’s the code:

local shadow1 = game.ReplicatedStorage.Shadow1:Clone()
shadow1.Parent = workspace
shadow1.Position = Vector3.new(character.HumanoidRootPart.Position.X, 1099.97, character.HumanoidRootPart.Position.Z)
local shadowtween1 = TweenService:Create(shadow1.SurfaceGui.ImageLabel, tweenInfofast, {ImageTransparency = 0.2})
shadowtween1:Play()
local missile1 = game.ReplicatedStorage.Missile1:Clone()
missile1.Parent = workspace
missile1.Position = Vector3.new(shadow1.Position.X, 1180, shadow1.Position.Z)
missiletween1 = TweenService:Create(missile1, tweenInfonormal, {Position = Vector3.new(missile1.Position.X, 1099, missile1.Position.Z)})
missile1.Falling:Play()
missiletween1:Play()
wait(2)
local shadow2 = game.ReplicatedStorage.Shadow1:Clone()
shadow2.Name = "Shadow2"
shadow2.Parent = workspace
shadow2.Position = Vector3.new(character.HumanoidRootPart.Position.X, 1099.97, character.HumanoidRootPart.Position.Z)
local shadowtween2 = TweenService:Create(shadow2.SurfaceGui.ImageLabel, tweenInfofast, {ImageTransparency = 0.2})
shadowtween2:Play()
local missile2 = game.ReplicatedStorage.Missile1:Clone()
missile2.Name = "Missile2"
missile2.Parent = workspace
missile2.Position = Vector3.new(shadow2.Position.X, 1180, shadow2.Position.Z)
missiletween2 = TweenService:Create(missile2, tweenInfonormal, {Position = Vector3.new(missile2.Position.X, 1099, missile2.Position.Z)})
missile2.Falling:Play()
missiletween2:Play()
wait(0.7)

missiletween1.Completed:Connect(function()
print("missiletween1 complete")
local boom = game.ReplicatedStorage.ExplosionEffect:Clone()
boom.Parent = workspace
boom.Position = workspace:FindFirstChild("Missile1").Position
boom.Splorch:Play()
boom.ParticleEmitter:Emit(3)
workspace:FindFirstChild("Missile1"):Destroy()
workspace:FindFirstChild("Shadow1"):Destroy()
end)

missiletween2.Completed:Connect(function()
print("missiletween2 complete")
local boom = game.ReplicatedStorage.ExplosionEffect:Clone()
boom.Parent = workspace
boom.Position = workspace:FindFirstChild("Missile2").Position
boom.Splorch:Play()
boom.ParticleEmitter:Emit(3)
workspace:FindFirstChild("Missile2"):Destroy()
workspace:FindFirstChild("Shadow2"):Destroy()
end)

Not even the print shows up in the console, so it seems it’s not firing at all. I’ve tried getting rid of the second “missiletween2.Completed”, and that didn’t work, either. Is there something I’m missing?

Since you’re yielding, it’s possible the the tween has already completed before the wait(2). So the script doesn’t catch it, that’s my assumption.

2 Likes

Yup, he is setting up the event after it has already been fired

1 Like

That makes sense. I knew it had to be something silly and small like that. Thanks guys!