Search Unity

UNet bugs all over the place, fixed after re-building the Player prefab.

Discussion in 'UNet' started by zazoum, May 31, 2017.

  1. zazoum

    zazoum

    Joined:
    Sep 3, 2011
    Posts:
    78
    I've made quite a long way to understand basics to intermediate UNet and I'm quite familiar with it.

    BUT! Even with latest 5.6 build I have the same problem:
    At some point of my workflow, everything gets mixed up. Weird bugs, bullets not spawing, errors of all sort of types. For the three months I'm using Unet I learned to say to myself: "Ohhhhh! It is THAT time again!

    And what is THAT time? It is stripping out my Player prefab from all its components and then re-adding them, so I can re-add the NetworkIdentity component. That is the one causing the problems. After that everything works wonders again!

    Is anyone facing the same problem? Is it a bug on the list to be fixed? It is pretty tedious process.
    Are there best practices to re-assemble the Player Prefab faster, without removing and re-adding all components and scripts and references to public GameObjects from scratch?

    It is not unsolvable. It is tedious.
     
  2. robochase

    robochase

    Joined:
    Mar 1, 2014
    Posts:
    244
    can't say that i've seen this problem. you should try to isolate the behavior to see what is causing it. like maybe you're writing stuff to the prefab you shouldn't be, or certain references are getting trashed occasionally.

    as for a swifter recovery, you should probably be using version control of some sort (git, svn, etc). rebuilding the prefab should just be two mouse clicks away if you've got version control running. version control will also help you isolate the specific bug you're experiencing too. make sure you select the option in unity that has your meta data be text files. when your meta data is checked into version control, you can get a really deep understanding of how a prefab changes over time.

    alternatively, you could try re-importing the asset to see if it fixes anything. right click it in your project window and select 'reimport'. good luck!
     
    zazoum likes this.
  3. zazoum

    zazoum

    Joined:
    Sep 3, 2011
    Posts:
    78
    Thanks for the reply.
    Just to demonstrate the error is not just me. Look at this question:
    http://answers.unity3d.com/questions/1309556/gameobject-player-is-a-prefab-it-cant-be-spawned-t.html

    And look at the last post by the user "Heremeus" that says he re-constructed the prefab by removing the NetworkIdentity and everything depending on it and then re-assigned it and it worked!
    The error in that Question is one of the error I get when this bug havoc starts. I'm using the same solution as he, but it is tedious.
     
    Last edited: Jun 1, 2017
  4. Zullar

    Zullar

    Joined:
    May 21, 2013
    Posts:
    651
    I've seen many other people have the same issue and re-building the prefab fixes the problem. I've never ran into this bug myself, but I think I've seen about 10 posts on it.

    Bug report if you can.
     
    zazoum likes this.