- Home /
Question by
RPGghut · Jun 08, 2015 at 10:49 AM ·
instantiatephotonparticle system
Need help with client particles over photon
Hello people of the unity community, I did the Merry Fragmas tutorial from Unity's live training archives and I found out that the impact particle system and the muzzle flash doesn't show on other clients. I have been trying to fix this problem all day put i can't seem to get it working. This is the code that was used in the tutorial to play the impact particle system. If someone could help it would be great.
void FixedUpdate()
{
if(shooting)
{
shooting = false;
RaycastHit hit;
if(Physics.Raycast(transform.position, transform.forward, out hit, 200f))
{
if(hit.transform.tag == "Player")
hit.transform.GetComponent<PhotonView>().RPC ("GetShot", PhotonTargets.All, damage, PhotonNetwork.player.name);
impacts[currentImpact].transform.position = hit.point;
impacts[currentImpact].GetComponent<ParticleSystem>().Play();
if(++currentImpact >= maxImpacts)
currentImpact = 0;
}
}
Comment
"shooting" can be turned into a function that runs as a command on the server, and then showing the confetti can be turned into a function that is called from the command as an RPC.