Tweening Clock Time Issue?

That’s the point, It can never reach anything above 24, so It will repeat until it does which it never will

When I tested it, the tween stops right after it reaches 24. It never repeated itself afterwards

Your tween is only being played one time, right?

It is stated here:

No

Character Limit

I understand that, I did read your original post. I’m saying that there could be something else causing this issue which wasn’t mentioned in the original post since I’m not having the same issue with the script as you are

There is no other script but this one, I opened another place to test it to avoid that issue, I checked and no, Nothing Stopping it on the Module Script, nor the Script requiring it

Edit:
@9100ryan I added an Extra Detail:

I think thats already been done This Dev forum post should help

it has some information on how to make it stop and stuff

Thanks, but thats not what i want, i just want a simple Cycle that repeats

I’m pretty sure it does repeat forever I was talking about in the comments of that devfourm post

Yes, but read my post again before replying:

Edit:
Oh i see what you mean, but still, What is a fix to this besides other Scripts?

game.TweenService:Create(game.Lighting, TweenInfo.new(
	10,
	Enum.EasingStyle.Linear,
		Enum.EasingDirection.InOut
	),
		{ClockTime = 24 - 0.001}):Play() -- Should Repeat Without TimesRepeated

All you gotta do is make it very close to 24 to have it function.

Sorry, This just gives me the same result

Same Situation as here

Just create a function that plays tween and loop it everytime once the tween ends

I’m not sure I understand. Why should it repeat? A tween only interpolates a number or a data type a single time unless specified, and then it will stop when it’s done interpolating. It won’t repeat assigning a value to a property until it’s exactly equal. So you will need to use either a loop or set the repeat count to -1 for it to repeat.

if Lightning.ClockTime == 23.999 then
   Lightning.Clocktime = 24
end

Try to add this script, it will make the Tween go from 23.999 to 24 (i think, I never made it).

Bro, As Explained here:

Char Limit

1 Like

Yes, but that isn’t how it works. It doesn’t repeatedly assign a value to a property until the value of the property is exactly the same as the goal, it just interpolates a number (0) one single time to 25 and tries to apply it to the property. It doesn’t take into account the value of the property at any time except when the tween is first played.

Youre right it doesn’t, but thats not what im saying, im saying it continues until it reaches the goal which it never will

I’m still confused, you’re saying it repeats infinitely and it shouldn’t? Or it only plays once but ends after one cycle?

Omg Thank You! I feel like an idiot for this,

This is the script:

function WeatherHandler:CreateDayCycle(
	Time: number,
	EasingStyle: Enum.EasingStyle,
	EasingDirection: Enum.EasingDirection
)

		local T = game.TweenService
game:GetService("RunService").Heartbeat:Connect(function()
T:Create(game.Lighting, TweenInfo.new(
			math.clamp(Time, 1, 10), -- Me randomly playing with math LOL
			EasingStyle,
			EasingDirection,
			--math.huge Useless
			),
			{ClockTime = 48}):Play()
		if game.Lighting.ClockTime == 0 then
			
		game.Lighting.ClockTime = 23.999
	end
	end)
	
end
1 Like

Heya, I just so happened to check this website and saw @Developing_Scripter mention my resource. A better way to loop your tween would be by using Tween.Completed:Connect().

--PHASE 1, Create Tween

local Tween = game:GetService("TweenService"):Create(game.Lighting, TweenInfo.new(24, Enum.EasingStyle.Linear, Enum.EasingDirection.In,0,false,0), {ClockTime = 23.99})

--PHASE 2, Connect RBXScriptSignal (Event) to function

Tween.Completed:Connect(function()

game.Lighting.ClockTime = 0

Tween:Play() --Loop

end)


--EXECUTION

Tween:Play() --Launch Phase 1

This method helps you be 100% sure your tween is finished and will not fail on you.

1 Like