Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Bullet Projectiles wont spawn, beacuse of incorrect Network Object IDs

Discussion in 'Netcode for GameObjects' started by ZapperSan, May 19, 2022.

  1. ZapperSan

    ZapperSan

    Joined:
    Feb 15, 2020
    Posts:
    2
    I am having serious problem that I have tried to solve for few days now. Currently I am making my Bachelors thesis, which is due in 4 days, so I really have to finish this ASAP.

    There are 5 scenes, out of which 3 are using MLAPI ver. 0.1.0, since I started way before 1.0.0 came out and I have no time to rewrite everything to work in 1.0.0. All of the scenes are set up acording to DapperDinos tutorial, like this:
    https://docs-multiplayer.unity3d.com/netcode/current/learn/dapper/dapper-video

    In Lobby scene, there is LobbyUI object, that has component "Network Object", which yields me this error:
    upload_2022-5-19_16-18-8.png

    Once I launch the actual game, everything spawns well except any other new bullets, that should spawn when client sends ServerRpc asking to spawn new bullet. It spawns on server side, it even says that it has been spawned in Inspector:
    upload_2022-5-19_16-21-16.png
    But it doesnt spawn on Client side and after its despawned on Server side, it simply yields this warning:
    upload_2022-5-19_16-22-42.png

    Now i could be wrong but what I think is happening is either Client trying to recycle the ID of 1, even though the server spawns object with ID of 9, like this:
    upload_2022-5-19_16-25-49.png

    Or there is some kind of object visibility magic hindering the whole process. Anyone knows what is happening? Im pretty desperate....
     

    Attached Files:

  2. ZapperSan

    ZapperSan

    Joined:
    Feb 15, 2020
    Posts:
    2
    OK, so I ve ran some tests and it seems that newly spawned bullet object is for reasons unknown invisible to the client.
    upload_2022-5-19_16-32-6.png

    upload_2022-5-19_16-32-22.png

    Is there a way to make the object spawn as visible to everyone?

    EDIT: I ve just noticed that it actually IS visible since i forgot to add ! to if, so its not the issue of visibility after all....
     
  3. Ukutura

    Ukutura

    Joined:
    Jan 16, 2022
    Posts:
    10
    Did you register your prefab in the network manager?