#How can i have a part follow a player smoothly with a bit of lagging behind?

1 messages · Page 1 of 1 (latest)

olive pendant
#

I tried using tweenservice but there doesnt seem to be any way to use that efficiently as you cant inject new end positions into a tween it seems and creating a new tween every frame is way too much computation and causes lag.

Apparently I can use lerp but im still trying to understand how that can be used for my case

radiant sundial
#

Use module script + loop

#

You can make variables for starting and ending positions, and continuously tween it

olive pendant
dry parcelBOT
#

studio** You are now Level 4! **studio

split steppe
#

do u mean following u like a pet

olive pendant
#

yeah

#

all of the tutorials have it directly follow the player but i want it to catch up to the player once they stop

drowsy tinsel
#

like pet sim wehn you teleport somewhere?

fresh thistle
#

wdym by follow?

olive pendant
#

uh i dont play pet sim

#

i got it working on server side i think but its slightly laggy when following

#

hold on

#

this was what i was trying to do except theres a slight stuttering or lagging while it follows

fresh thistle
olive pendant
fresh thistle
#

is it on the server

olive pendant
#

yeah

fresh thistle
inland solstice
#

Then boom

olive pendant
fresh thistle
inland solstice
#

If he wants an offest there should be a setting inthe alignpos object, if nit then creatr a different part welded to the hrp and attach the delayed part to the object

fresh thistle
#

just tell every client

#

make this follow this player

#

once

inland solstice
fresh thistle
#

you clearly have never done networking outside youtube tutorials

#

the biggest thing to keep in mind when making multiplayer for any game

#

is to handle as much things on the client as possible

olive pendant
#

isnt it the opposite in roblox

#

so that the client cant edit stuff

fresh thistle
#

no, thats only because of security concerns

inland solstice
#

Why not create a server script loop that uses tweenservice to constantly play a tween moving the part to a cframe offset to the hrp with enough speed to look delayed?

fresh thistle
#

but that doesnt matter for visuals or if you have server authentication

#

just dont be stupid and it wont be an issue

fresh thistle
#

just use alignposition at this point

#

🙏

inland solstice
fresh thistle
#

its not a good option but its the only option you guys seem to comprehend

#

and its better than any of the other abominations your suggesting

inland solstice
#

Then whats your solution?

fresh thistle
#

i said mine

green swan
#

making visual on server instead of client is stressing the server replicating that object to clients

fresh thistle
#

wha is your point

green swan
#

you're saying to do visual on clients instead of server, i assume replication?

fresh thistle
#

yes

radiant sundial
#

if you continously have tweens being made then it shouldnt be a problem