Tween won't play again

I have no idea what’s happening, why doesn’t the tween play again?

Code (There’s more but it is unnecessary):

		local Speed = 75
		local tweeninfo = TweenInfo.new(Speed, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false, 0.5 )
		local ChaseTween = TS:Create(workspace.Darkness, tweeninfo, {Position = Vector3.new(31.6, 21.8, 1377)})
		ChaseTween:Play()
1 Like

The issue may be that u are not changing the Darkness object position after the first tween has played, the other tweens just targets to the same position again and again

I did that already.

	Prompt.Enabled = true --Unnecessary
	Darkness.CFrame = CFrame.new(31.3, 21.75, -7.45)
	Darkness.SurfaceGui.Smiler.Visible = false --Unnecessary

Because it is in the same position, It may not appear as the tween is playing, But it actually is. You just dont see it because the part is in the same position.
To make it play again, Use a CFrame instead.
Try using this: CFrame = object.CFrame * CFrame.new(10,10,10)
I know this will work since i am using it in several other creations.
Hope this helps you!

image

You arent telling the tween to repeat

looking at your code, the TimesRepeated Argument is set to 0, meaning it will only fire once
Try this:

Speed = 75
Darkness = workspace.Darkness

Tinfo = TweenInfo.new(
Speed,
 Enum.EasingStyle.Linear,
 Enum.EasingDirection.In,
 2, -- I don't remember if it repeats twice or 3 times
 false, -- Change this if you want a Reverse Effect
 0.5
 )
local ChaseTween = TS:Create(Darkness, Tinfo, {Position = Vector3.new(31.6, 21.8, 1377)})
ChaseTween:Play()

To make the Tween Repeat forever, change it to -1

The Tween Resets when its supposed to play again

This is not the Case,
The Tween is Completed, but its not playing again due to the fact TimesRepeated is set to 0

SurfaceGui’s dont use CFrame. im pretty sure they use UDim2

Sorry for the late response. I forgot I posted this :joy:
Anyways, It did repeat, however I just want it to play when I want to, not repeat the tween.

Documentation suggests you may need to call stop on the tween to play it again.
Not entirely sure.

If you need to replay the same tween though, or delay its replay - there are specific parameters for this.

See documentation.

Tween | Roblox Creator Documentation

I cancelled it, and it didn’t work!

You need to elaborate more on your issue.
What causes the tween to play?

Part.Touched:Connect(function()
	if GameStarted.Value == false then
		GameStarted = true
		print("Game Beginning")
		print("Game Began")
		Smiler.Visible = true
		Light.Brightness = 5
		Sound:Play()
		wait(.1)
		Sound2:Play()
		_G.ChaseTween:Play()
	end
end)
while true do
	wait(0.01)
	if DoorClosed.Value == false and (Darkness.Position-Trigger.Position).Magnitude < 4 then
		_G.ChaseTween:Cancel()
		print("yes")
		CheckMagnitude()
		wait(15)
	end
end

When the tween is done set everything back to its original.
Example:
a tween plays changing somethings color to (255,255,255)

and the original part color is (0,0,0)

you would change it back to (0,0,0) after the tween is done