- Home /
Syncing particles
Hello, How would I go about syncing particles in a ray-casting script? The ray-casting script detects where the it was hit and then creates a particle there. How would I sync the particles with multiplayer? Thanks for the help!
Particles and particle emitters are a purely graphical element to the system. I rather suspect you will find there is no way to synchronise their behaviour over multiple machines, as the varying graphics and CPU capability of each machine will cause variance in their display anyway.
Well, is there a way that I can create an emitter on at the same point on the other persons client. I don't care if the particles themselves sync perfectly I just want them to be on the other persons screen.
Answer by syclamoth · Jan 16, 2012 at 06:31 AM
If you want to synchronise bullet hits on walls, all you have to do is manage the raycasting on one machine, and then upon hits send a message with the position and normal of the hit to all the other clients!
[RPC]
void SpawnParticleEffect(Vector3 position, Vector3 normal)
{
Instantiate(particlePrefab, position, Quaternion.LookRotation(normal));
}
If there's other behaviour you want to synchronise (like damage, knockback etc) you can use the same technique for that as well.
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Unity NetworkTransformChild - Syncing the Child of a Child 0 Answers
how to test your multiplayer game 2 Answers
Unity/Photon chat system error. 1 Answer