"RunTweenService" | TweenService Module

About

RunTweenService is a TweenService module that uses RunService instead of tweens, mainly using the :GetValue() function for calculations. This was mainly made for optimization & the ability to sync up with already playing tweens like loops. This is also my first public module.

Module: https://create.roblox.com/store/asset/15659254712/RunServiceTween

:memo: Features

It does not have any extra usable features, but it does have benefits when using it such as:

  • Client replication (To reduce network latency)
  • Sync up with already playing tweens (Especially loops)

Unfortunately, this can eventually go off-sync over time compared to a real tween especially both playing in a loop, so I recommend using this for optimization instead. This might be fixed once I find a method that stops or reduces this issue.

:grey_question: How to use

Server: Simply require the module and use it as you normally would with TweenService.
Client: There is no reason to use this module on the client, so all you have to do is just require it and it should replicate any tweens created by the server.

When inserting the module, place it in game.ReplicatedStorage or anywhere that can be replicated to the client.

Comparison

Here is a small clip of several tweens playing at once. Green parts are normal server tweens, Blue parts are “tweens” done from the client.

15 Likes

I can’t load it on google, although what if a users FPS is very high or very low, would that affect the fake tween since renderstepped runs on users FPS?

5 Likes

Yeah can’t seem to get the video to work. The FPS should be fine since I’ve clamped the “TotalTime” of a tween so it doesn’t go over the goal.

3 Likes

I actually thought of this idea of tweening it for the client and replicating it from the server but never actually got it to work…

So this is really helpful!

How would the replication work? Would it replicate once the tween has finished?

3 Likes

It replicates to all clients when :Play(), :Pause() or :Cancel() functions are called. This also does the same method TweenService V2 does whenever a tween has finished and applies the new properties on the server.

2 Likes

Thank you, this is going to be useful for my Cutscenes plugin. Thank you!

1 Like

The module itself is good, but it doesnt works on loops, it just plays once in while true do loops

1 Like

i’m going to use this module everytime i need to tween.
thank you a lot!! ^-_^-

1 Like

Can you send the script of this issue happening? Can’t seem to recreate it properly.

it’s a normal loop

local tweens = {
	tween_1 = requireruns.Create(nil, fumocirno, TweenInfo.new(0, Enum.EasingStyle.Sine), goals["cirnoSize"]),
	tween_2 = requireruns.Create(nil, fumocirno, TweenInfo.new(0.5, Enum.EasingStyle.Linear), goals["cirnoSize1"])

}

local fumoanim = coroutine.create(function()
	task.spawn(function()
		while true do
			fumocirno.Size = fumocirno.Size + Vector3.new(X_INCREMENT, Y_INCREMENT, Z_INCREMENT)
			fumocirno.CFrame = fumocirno.CFrame * CFrame.new(0, Y_INCREMENT/2, 0)
			task.wait(0.7)
			tweens["tween_1"]:Play()
			task.wait(0.15)
			tweens["tween_2"]:Play()
			
			

		end
	end)
end)

coroutine.resume(fumoanim)

if you can, you could test it on a loop you want, and send me the code so i can see if it works for me

the tweens[“tween_2”].Completed:Wait() also doesn’t works