Search Unity

Particles on a Network Multiplayer Game

Discussion in 'Multiplayer' started by gerudoking, Sep 14, 2018.

  1. gerudoking

    gerudoking

    Joined:
    Jan 25, 2013
    Posts:
    4
    Hello,

    I'm having quite some trouble trying to make particles work on the game I'm developing. The game use Unity's networking features, and as I'm finding almost nothing related to this topic, I believe it's something quite simple I'm not understanding. The context and some scripts related to it are in this question on Unity Answers:

    https://answers.unity.com/questions/1552544/particles-and-networking-particle-system-not-worki.html

    As far as I know, if I call the particle system's Play method on the update of the game object, without any conditions, the method will be executed on all clients and on the server, since the object is not a server only object. Even so, this game object(that was spawned by the server and has a particle system component attached to it) is not working the way it should be, as the particles(a trail effect) do not show up on the clients(only on the host), but everything else about the object works fine.

    I don't know if I got the wrong idea about how this should work or if there are limitations on the use of particles on Unity multiplayer(I think the first possibility is more likely to be the one), but I'm really stuck on this. If anyone knows anything about the issue, I would really be grateful!
     
  2. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    you should not fire event for sounds / particles but instead sync the action that trigger all those visuals or even better the input

    so have :
    when use fire=> on server calcul damage, then all clients receive damage and trigger the sounds event and particle from a client function like OnReceiveFireEventFromServer