#tweenservice client-server

1 messages · Page 1 of 1 (latest)

sweet flower
#

i made a script where when i click a door, it opens but the tween happens client side to make it run smoother, the problem is that other one cant see the door opening since the tween happens on client. should i make like a remote event that opens the door for all clients?

dusk dune
#

do it like this

client clicks door and fires server -> server does security checks and shi and then fires to all clients if security checks are passed -> door tweens open on all clients

warm zealot
#

tween it on the server

#

use a clickdetector so you can detect clicks on the server

#

no client code necessary. server scripts only.

uncut grove
#

you NEVER tween on server

#

NEVER

warm zealot
#

reason?

uncut grove
#

the cost of replication in network

#

plus its way smoother on client

warm zealot
uncut grove
#

well, it is not how tween service works, you need to code that for yourself at least now

warm zealot
#

it's sending property changes every frame, isn't it.. i can't find anything concrete on that but ughh roblox sometimes deepsigh

#

...which also messes with server sided physics since if you send a signal to run a tween, that wont be reflected on the server

#

if true, that is really stupid

warm zealot
# uncut grove you NEVER tween on server

i'll keep this in mind, kinda curious how you figured this out as it didn't really occur to me. i'd still say tho for some things and in some situations its easier to tween on the server, like in this case a beginner trying to make a door tween that replicates

sweet flower
dusk dune
dusk dune
warm zealot
sweet flower
#

then if it is closed it setattribute open and pass it to the client making the tween happen

#

so i just need to use events and make it happen for all clients right?

dusk dune
sweet flower
#

so from this moment

#

should i tween always on client for performance and smoothness?

warm zealot
dusk dune
#

there is no reason to ever tween on server

warm zealot
# dusk dune there is no reason to ever tween on server

example of where you almost cant avoid it is if you have this door and you're trying to pathfind an npc through it, it'll get stopped by the door since its still closed on the server even though you opened it on the client, bit of a tricky situation that one

sweet flower
#

but

#

wait

#

i was thinking

warm zealot
#

so obviously the door would have to be designed some other way to avoid that problem, which is what 'if irrelevant to the server' is referring to

#

or maybe you just dont care and the door only exists on the client, or something

sweet flower
#

i want an npt to go trough a door that i opened on client, the npc would see that door as closed

warm zealot
#

server-sided copy in the server camera maybe so you can tween it without replicating it?

sweet flower
#

but i can still change that on server side and make that the door doesnt collide with the npc so it counts as open, something like that

dusk dune
sweet flower
#

at the end there is always more than a method for everything, i was just curious about wich was the most “performing one” and i think ill stick to tweens on client

warm zealot
warm zealot
#

that'd be the lazy way ;p

#

this seems like a really annoying problem, i'm surprised i havent heard of this before

#

and i can't find much on it either

sweet flower
#

idk how to explain it its a bit tricky

warm zealot
sweet flower
#

this is for nocs

#

npcs

warm zealot
#

well, this is why i go through threads like these, you just never know what you'll find sometimes

sweet flower
#

wait i was thinking

#

do i need to make a remote event for every door

#

i dont think?

warm zealot
#

nah you'd be able to generalize that fairly easily

#

i.e you could use one remote and fire the root of the door model since you can pass instances through remote event