Sync particle effects in multiplayer
How do you sync particle effects over the multiplayer network? I need to make it so all players can see the particle effects emitted. I am converting my singleplayer game to multiplayer, and I am not familiar with most of the syntax because this is all new to me.
The particle effect is a laser that emits at a mouse click. Only the local player can see it.
Please explain as clearly as possible, Thanks.
Answer by ifurkend · Mar 18, 2017 at 03:39 AM
You generate your own uint for ParticleSystem.randomSeed and enforce this value on all players. Let's be frank, you gameplay should not rely on the precision of particle behavior because it is designed to be constantly randomized.
The gameplay does require precision of the particle emitted. I did not write the script or make the effect, just trying to make it work how it is.
Also, @ifurkend I dont't really understand your answer. How does ParticleSystem.randomSeed help sync the particle effect with all clients?
The default setting of particle system has its emission seed randomized by default (useAutoRandomSeed), if you see the particles emitted behave differently from different player, your only option is to write a script to generate a unified ParticleSystem.randomSeed for all players. If you still don't have a good idea, ask the question on general graphic forum with the "particles" tag. I still insist that you should never ever rely on particle system for precise gameplay mechanics, it is only for visual clue.
The problem isn't that the particles behave differently on each client, it is that I cannot see them at all. They are being emitted locally and I do not know how to make it so others are able to see them. I think the way I asked the question might have been confusing, so I hope that clears it up