Tweening twice (and delayed) after client replicating?

Are you sure the issue lies within the local script and not the script that fires the event? Perhaps the event is just being fired late?

1 Like
  1. The script that fires the event is the same (it starts at this local script, then just go to a server script that simply redirects it to the other clients and then come backs to the same local script), so no.

  2. The manually replicated tween works just fine, but the automatic one doesn’t (which happens delayed, after the manual one).

There isn’t just a way to avoid the automatically replicated tween (if it is even a tween, because it looks like just an automatic position correction)?

Thank you for replying!

Why not fire from the server to all clients like this architecture (server → all clients).
This way, it wont be seen from the server but it will be seen from all clients.

1 Like

I’m doing exactly that (just avoiding it to see it twice by the original tweening character):

Server script:

remote.OnServerEvent:Connect(function(plr)
	Activated() --ignore this
	for i,v in pairs(game.Players:GetPlayers()) do --gets all players
		if v ~= plr then --checks it isnt the same player
			print(v)
			remote:FireClient(v,plr) --redirects the remote
		end
	end
end)

Thank you for replying!

I think you should just really be firing it to all clients and then you can do the tweening, instead of tweening it to the client first, and then firing it to all clients except for that specific player.

(try also testing it with 2 players)

1 Like

Now it happens (the double tween issue) in all of the clients (even in the original one), even though it is only called once (with the :FireAllClients call)

I already have been doing that.

Thank you for replying!

Are you performing the tween(s) on the client or the server? Tweens performed on the client will be smoother than tweens performed on the server.

2 Likes

As I said, I’m performing tweens from client (and replicating them to all of the other clients), but for some reason it happens two times (on the other clients; since it works perfectly on the original client): the first one (as it should, totally smooth) and a second one (not smooth and delayed).

Thank you for replying!

UPDATE
I confirmed my own theory: it is actually tweening twice. I tried using this module (which makes it easier to replicate tweens) and got a message on output “Canceled a previously running tween to run requested tween”, this means that another tween is trying to play (for no apparent reason).

Do any of you know why does this happen and how to fix it?

Thank you for reading!

Remove the replication entirely. Roblox should be automatically replicating it.

1 Like

As I told you before, the automatically replicated isn’t smooth at all and it is pretty delayed, so I can’t use that one.

Thank you for replying!

Unfortunately you cannot DISABLE Roblox’s automatic replication, and therefore it will still occur even if you improvise and replicate manually. With that being said, if you replicate using the module or with any other manual method, you will always run into the issue of the tween running twice.

1 Like

But I’m creating the tween on a client, why it replicates to the server (since it shouldn’t)? This is really weird; also, if I remove the replication, the only tween shown will be one like the second one (delayed, not smooth, quicker).

Thank you for replying!

It should. Most changes to the character via the client are automatically replicated to the server. For example, if you changed your walkspeed on the client, it will replicate to the server. The same applies to CFrame changes, which explains the replication of your tween.

1 Like

Then how can I fix this? Since it is not smooth at all and delayed (just like if I would have created the tween directly from the server) and I can’t avoid it, what’s the point of tweens in the first place if they can’t be played correctly (since, regardless to what I do, they’ll always be replicated incorrectly to server)?

Thank you for replying!

Can you please demonstrate this replication issue you are describing?

1 Like

This looks like when I’m manually replicating (as you can see, character’s position is corrected as soon as I move):

This looks like when I’m not manually replicating (as you told me):
https://streamable.com/wu8fuh

Thank you for replying!

If the delay is a big deal, you could technically move the tween handling over to the server and only the server (via a simple remove event for example) and not rely on any replication.

However, some are against using the server for a detailed tween like the one you are attempting to create. If this applies to you, unfortunately the only thing I see plausible is to deal with the delay. Otherwise, my only other solution is to give this a try.

1 Like

It isn’t like that, I’ve seen a lot of tweens from client that actually are smooth and not delayed. I also have seen a lot of people replicate their tweens/VFX from a client to clients (so, if you’re right, all they’ve done would be absolutely inecessary.

EDIT: just like this.

Thank you for replying!

Also, just switched to :FireAllClients() instead of everyone but the original client (so it happens locally for each client and doesn’t get automatically replicated) but it is still happening.

Thank you for reading!