Hi,
So the code below is my current code and my goal is that when a bullet hits a collider it should be destroyed and two different particle systems should play on all of the clients. However, when the code below is executed, the particle systems only play on the local client. Is there any way to fix this?
[Command]
public void CmdAfterEffects(Vector3 position)
{
RpcAfterEffects(position);
}
[ClientRpc]
private void RpcAfterEffects(Vector3 position)
{
AfterEffects(position);
}
private void AfterEffects(Vector3 position)
{
ParticleSystem cloudParticle = Instantiate(GameManager.instance.GetProjectileManager().cloudParticlePrefab);
ParticleSystem burstParticle = Instantiate(GameManager.instance.GetProjectileManager().burstParticlePrefab);
cloudParticle.transform.position = position;
burstParticle.transform.position = position;
var cloudSettings = cloudParticle.main;
cloudSettings.startColor = color;
var burstSettings = burstParticle.main;
burstSettings.startColor = color;
cloudParticle.Play();
burstParticle.Play();
}