Search Unity

Items instantiating problems.

Discussion in 'Editor & General Support' started by dmitche3, Apr 5, 2014.

  1. dmitche3

    dmitche3

    Joined:
    Apr 3, 2014
    Posts:
    23
    I'm still trying to get my head around Unity so bear with me. Between the countless bugs in Unity and Mono that are far too many to repeat I've run an issue that has stopped me dead in development.

    My problem is that I have a prefab which is being created/instantiated twice from where and how I can't figure out.

    I have a prefab that I want to create on a network connection. No problem there. That works. It is the only place in my code that I instantiate my "PlayerGameObject" and that is "OnNetworkConnect()". I've run through Mono and found no problems with that method; it is only being called once, etc. In fact, I've commented out the network.Instantiate() and still the object is still being created.

    In my attempts to solve this mystery I renamed in my prefab folder the prefab to "Old playergameobject" and re-saved a copy of "PlayerGameObject". Now, "Old playergameobject" is being created twice. I've scanned all scripts and there isn't a reference to the renamed prefab, and I've checked all of the Inspector entries and there is no reference to it.

    My question is, other than using an "instantiate" method, what other ways can an object be created? I'm hoping that something will trigger a thought in this exhausted brain of mine. :)

    Thanks for your patience.
     
  2. dmitche3

    dmitche3

    Joined:
    Apr 3, 2014
    Posts:
    23
    Well, between scripts not being compiled and therefore source not watching the executable and who knows what else another hour and finally it is working again. But for how long and what caused the problem other than perhaps that commenting out my instantiation and other lines of code were still being executed!!!

    I won't be convinced differently but the combination of two products,Unity and Mono is like working with a brain surgeon and a politician. Brains and hype. :(