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

How should I handle projectile replication?

Asked by 5 years ago
Edited 5 years ago

My wand has come a long way since the last time I was on this website, but I really need to optimize the way my projectiles are replicated. Currently, I'm doing all of the projectile related code on the server. It does work, but I can tell that it isn't the most efficient solution. I want to minimize lag in terms of these projectiles, because when rendered on the client the projectiles look much smoother. This would of course make the projectiles work smoothly despite the quality of the user connection.

How could I do this? I need to somehow replicate the projectile to the client, and all of the other clients? Any advice? As of now, I'm thinking of something along the lines of :FireAllClients creating and moving projectiles for every player rather than on the server. Not sure how well that would work, but I just need some input from more experienced scripters on the best way to create this infrastructure. Thank you!

If you want to see the projectiles in action, you can play the game here. Just hold the wand and click.

0
You can use network ownership to optimize your code. Take a look at this article on the roblox wiki: http://robloxdev.com/articles/Network-Ownership. It also includes an example with projectiles saSlol2436 716 — 5y
0
My parts are anchored and I CFrame them along a ray to make them move. You can't set network ownership for anchored parts. ThatPreston 354 — 5y

Answer this question