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!
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.