Search Unity

Third Party Mirror - registered spawnable prefabs not allowing other assets

Discussion in 'Multiplayer' started by Deleted User, Jul 23, 2020.

  1. Deleted User

    Deleted User

    Guest

    So I was working my way through the Wireframe UK magazine tutorial for creating a multiplayer space shooter game in Unity. The network aspect of the game used the Mirror asset from the unity asset store (https://assetstore.unity.com/packages/tools/network/mirror-129321).

    There was a section on creating explosions effects when a projectile hits an enemy ship. The effects had to be downloaded from another asset on the unity asset store (https://assetstore.unity.com/packages/vfx/particles/3d-games-effects-pack-free-42285).

    The problem was, when I was testing my game via the use of the localHost unity player and windows running builds of the game, which worked via local communications, explosions wouldn't appear. I then realised this was because the effect prefab hadn't been registered as a spawnable prefab by the network manager.

    However, the list won't let me add the effect asset to it (as it automatically returns to whatever was previously selected), and it won't allow any of the other selectable objects from the effects back to be included either.
    upload_2020-7-23_16-15-0.png
    upload_2020-7-23_16-15-31.png

    Has anyone else ever had a problem like this. Does anybody know of a possible solution?
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Do these effect prefabs have the required NetworkIdentity component attached?
     
  3. Deleted User

    Deleted User

    Guest

    No they didn't, but then I put them in and they worked! Thank you very much.

    Unfortunately now I'm running into other problems.
    For one, the explosions do show up in the hierarchy list, so they are definitely added to the window view of each game, but I don't really see the explosions themselves where they should appear.

    Another problem I have is do to with trails of each player's rocket ship in the game.
    When a new player is added to the game, they spawn in the middle then immediately jump to where they should spawn, and leave a trail which should not be there.
    So my natural instinct was to disable something that would make the trail appear as soon as the player is added to the game, then re-enable it after the player spawns in their proper position. However, this causes the trail to not appear at all.

    For reference, these are the statements I have tried adding to the start of my "OnStartClient" method with their corresponding "true" statements ending the method that I try to use to fix the trail problem, but end up not giving a trail at all. "objectTrail" is set as a public GameObject related to the trail object.
    upload_2020-7-24_15-41-6.png
    upload_2020-7-24_15-41-55.png

    (And no, this has nothing to do with the networking because there's another type of object that leaves a trail and it works just fine)