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.
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.
Good day,
how would you set the tween to repeat?
Regards
This is awesome! Thanks, Iāll add this to the original post
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!
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.
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!
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ā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)
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ā¦
has been ~4 years and i still cant wait for the completed event.