TweenService for Entity System

Hey! I’m deathbandss and im making a game called Galactic Reckoning, so far I actually used tween for my entity system and atm It seems good but the Recv is really bad


shown here. If anyone could help me out and find out how to Lower the Recv that’d be appreciated a lot. If anyone knows anymore Pros and Cons to TweenService for moving entities then that’d also be great!

Are you playing the tweens on the client or the server?

1 Like

server I think, how would I play it on the client?

Use remote event. Parse the tween information (for example, cframe, position and ETC) to all client into
:FireAllClients().

Since there will be delay between server to client, add a limit if the client have high ping.
For example, set the part to anchor after 5 second has passed, then use the :FireAllClients()

Server :

local part = game.Workspace.Part
local event = game.ReplicatedStorage:WaitForChild("RemoteEvent")

event:FireAllClients(part, Vector3.new(15,15,15))
task.wait(5)
part.Anchored = true
part.Position = Vector3.new(15,15,15)

Client

local event = game.ReplicatedStorage:WaitForChild("RemoteEvent")

event.OnClientEvent:Connect(function(ins, newPos)
   game.TweenService:Create(ins, TweenInfo.new(5), {Position = newPos}):Play()
end)

Regarding tween on the server, I think it just fine as long there isn’t to much object that are tweened at any given time. You can handle visual/effect stuff on the client for better server optimization.

i plan on having a LOT of enemies in the game, should i do it on the client? then after the tween ends should i have the part on the server go where the tween ended? (the goal)

1 Like

If it crucial to your game system, make it on server.

You can instead your normal part on the server or blank dummy. This dummy appear can appear as basic as possible.

Then, render the accessories, effect or hats on client. This could save a few performance for the server.

1 Like

Do you think theres a way for me to maybe move a block or part on the server (using tween ig) and then on the client use PivotTo to have the enemy render onto said part? and would that be a better way then you just said?