TweenService V2

ReplicatedTweening.rbxl (38.2 KB)

This Module is very useful and makes Tween Replication a breeze. I noticed several people having issues making use of this module due to various errors. Here is a place file with a basic working example.

3 Likes

Good day,

how would you set the tween to repeat?

Regards

This is awesome! Thanks, Iā€™ll add this to the original post

1 Like

Has anyone tried to to use this for a Zombie type game with some custom NPCs? I wonder how efficient this module would remain if you recalculated path finding every 1 second for the zombies?

Hey @SteadyOn!
I believe I found a bug/error:
Stop is not a valid member of Tween "Tween"
In the script: (line 217)

As far as I know, :Stop() isnā€™t a function in tweenService. Should this be replaced with :Cancel()?

Other than that, very thankful for you sharing this great module with us!

Edit:
I tried changing :Stop() with :Cancel() and it somewhat works. However, since the module interprets it as the animation finishing it automatically re-assigns the parts position to itā€™s pre-defined end position.

As in: I cancel the animation, and then it automatically (On the server, and hence, all clients) teleports to itā€™s end position INSTEAD of staying where it was cancelled.

Is there any thing I am doing wrong? Or is there any way to let the part stay when cancelled, and NOT be teleported to the end position that was defined in the tweenInfo? PS: This is when changing the :Stop() to :Cancel()

Thanks!

Do you have plans of trying to create a function like TweenService:TweenModel()? Iā€™m having a hard time tweeting models and keeping all of the same axis.

Iā€™ve tried for _, item in pairs(Item.Door1:GetChildren() do and it keeps on moving all of the axis and not just the 1 I want.

Someone else here already made it!

Just set any part of the model as a PrimaryPart (preferably part at center) and then tween itā€™s CFrame.

TweenService:Create(Model.PrimaryPart, TweenInfo.new(2), {CFrame = CFrame.new(Vector3.new(0, 20, 0))})

PrimaryPart is a property of Model btw

Is there any way to find when a tween ends using this module?

Hmm this is weird, maybe it was added in one of the commits I approved, will try to check it out when I have the time!

1 Like

Thank you! I appreciate you taking the time to fix this. While youā€™re at it, I found another bug (I believe):

So the problem is that I keep getting the error Tween being paused does not exist. when trying to pause tweens using remote events.

Doing:

tween:Play()
wait(2)
tween:Pause()

works great, but when I do something like this:

startEvent.OnServerEvent:Connect(function()
	tween:Play()
end)

pauseEvent.OnServerEvent:Connect(function()
	print("Pausing tween!")
	tween:Pause() 
end)

It starts the tween, when trying to stop it, I get the error: Tween being paused does not exist.

I am not sure why this happens, Iā€™ve looked at the code and tried to debug some. But it seems like the tween for some reason doesnā€™t get saved in the module (also in earlier lines than when the warning is printed).

By the way, for some reason it works if both :Pause() and :Play() is in the same event:

startEvent.OnServerEvent:Connect(function()

tween:Play()

wait(2)

tween:Pause()

end)

Iā€™ve talked with some other users who use this module, and they have the same issue. It would be nice if you could take a look at that also, since it working with remote events is quite important for many!

Thanks again!

Would you mind DMing me the whole script? Or just the relevant parts if itā€™s huge. Just want to figure out whether this is a module issue or a use case I didnā€™t consider.

1 Like

Iā€™ll be able to send it tomorrow, first thing. I currently donā€™t have access to my PC. Thanks for taking a look at it! :slight_smile:

Edit: Iā€™ve sent you a PM!

Hi, sorry for bumping this topic. But did you receive my DM?

Yeah that can be usefull, you think to add it?

Hey, I do have a problem with it and Iā€™m not sure why its not working. The script doesnā€™t error but the tween isnā€™t playing either.

			TweenModule:Create(Floors.Floor1.Doors.DoorL.DoorL.PrimaryPart, TweenInfo.new(DoorOpenTime, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), {CFrame = Floors.Floor1.Doors.DoorL.Org.CFrame}):Play()

Thanks if you can help.

I would suggest you use TweenService+, which is basically an upgraded TweenServiceV2

Iā€™m using this module for a long time and it helps me with replicating it easily, what I got today is this bizarre looking bug while i was about to animate my weapons but when i opened blender plugins and selected character, script runs but doesnā€™t stop even after stopped playing the game.

Tween still works but itā€™s somehow inaccurate when i played the game (client doesnā€™t run tween loops but does on serverside)

do note thereā€™s no edit being made, this is a raw video

1 Like

What a coincidence, I made a script that uses this exact idea to tween parts for my tycoon buildings. The first time I implemented and tested it, I was blown away at how phenomenal the lag reduction was when tweening on the client and verifying CFrame on the server! Damn, and I thought I was uniqueā€¦

1 Like

has been ~4 years and i still cant wait for the completed event.