Search Unity

Instantiate prefabs on specific network groups only.

Discussion in 'Multiplayer' started by unitygirl, Sep 24, 2010.

  1. unitygirl

    unitygirl

    Joined:
    May 25, 2010
    Posts:
    38
    Hi, I'm currently working on some fighting multiplayer game where many users login to the server and join different maps to fight each other.

    and I'm using network.Instantiate() to instantiate strike effects when my character hits the opponent:

    Network.Instantiate(StrikeFx, transform.position, transform.rotation, 0);

    But the problem is that when I instantiate this effects prefab, this effect can be seen in other players in different map.

    So I want to show this effect only to those players who are in the same map. I guess I can do it using network groups, but I'm not sure how to use it.

    Can anyone give me a clue??
     
  2. AkilaeTribe

    AkilaeTribe

    Joined:
    Jul 4, 2010
    Posts:
    1,149
    I haven't made my baptism of fire (coming soon...) in Unity Network, so my words don't have much weight.

    But if I were you, I would rather go for RPC, since Network.Instantiate will instantiate no matter what the situation is.

    By using a RPC, you are able to do tests before instantiating locally (Instantiate function).

    In addition, FX are not especially object that required a precise sychronization.