Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Is sending instances through script communication bad practice?

Asked by 5 years ago

There are many ways for scripts to communicate e.g. RemoteFunctions, ModuleScripts, but does sending Instances such as a model through these scripts cause problems? For example a delay between one script sending and the recipient script receiving?

0
there would probably be a bit of delay if you were to send something through to the server/ client, but sometimes it might be necessary like getting the mouse target of a player's mouse theking48989987 2147 — 5y
0
it's good to avoid it if you can. like for example, if i was making an inventory system, and the player clicked a weapon to buy, i could send the name of the item, and use it in the server to find an object in server storage or something Gey4Jesus69 2705 — 5y

1 answer

Log in to vote
2
Answered by 5 years ago

Instances are transmitted over the network as an identity, not a value. That is to say that all that the server (or client) tells the network is "Use the instance with this id", rather than telling the network anything about the instance you just sent. As a result, the amount of additional latency caused by sending a reference to an Instance is likely to be indistinguishable from sending nothing.

There will, of course, be a delay. But it's the same delay as when you spawn in an Instance on the server and the client has to load it in - Just slightly less, because there's less data being sent.

Ad

Answer this question