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. Dismiss Notice

Models not visible in game, please help.

Discussion in 'Editor & General Support' started by soundstone, Jan 18, 2015.

  1. soundstone

    soundstone

    Joined:
    Jan 18, 2015
    Posts:
    4
    Hello,

    First off, thanks for taking the time to read this post. I hope I am posting in the correct section. I've had this issue that has been plaguing me for a few days now, and despite my searching for and trying different solutions, it seems I just can't seem to get the instantiated models of my bullets to be visible in the game.

    They are visible in the Scene window as wire frame boxes surrounded by their box colliders, I have seen similar issues but the solution was always make sure the proper layers are marked as visible. I've included some screen captures to show my editor setup in regards to: 1) invisibleBullet is captured from the Scene Window, 2) layerLayout is the layers & tags each bullet is assigned to 3) layerVisible is the Layer drop down (from upper right corner of editor).

    As you can see in the pictures, all of my layers should be visible, so this is not the solution. Is there anywhere else in the editor I can check for a preference of reason that these models are showing?

    If I drag an instance into my game hierarchy they are visible, which is how these should be once instantiated, please see imageVisible screen shot for how the model should look.

    If it matters, these are not prefabs that are pooled, rather they are created and destroyed as needed. I plan to pool them eventually, but I'd like them to actually show up before I worry about changing the code for their creation.

    Thank you in advance for any help you may provide.

    Regards,
    Soundstone
     

    Attached Files:

  2. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,623
    Mmm ... maybe I'm not understanding properly, but do you have the camera set to pick up the correct layers?

    The "visible layers" setting is for the Scene view. But the Game view comes from cameras.
     
  3. soundstone

    soundstone

    Joined:
    Jan 18, 2015
    Posts:
    4
    Hey hopeful,

    thanks for the reply. I think that you are talking about the Culling Mask on the Camera. If that is correct, then yes all layers are checked off as visible. Is this what you were referring too?
     
  4. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,623
    Yup, that's what I meant. Aside from that, I can't think of why an active mesh in camera view won't show up.

    (It is in the camera view, right? Inside the frustrum?)
     
  5. soundstone

    soundstone

    Joined:
    Jan 18, 2015
    Posts:
    4
    Yes the objects are created within the frustrum. The weird thing is that if I drag the bullet prefab into my scene directly it shows up just fine. I've matched the instantiated bullets to be these coordinates as well. When instantiated however, it only activates as a shell. Maybe a bug within Unity?
     
  6. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,623
    Too bad it's not the frustum. I've had a pretty good streak going lately telling people they could fix their problem by adjusting the near plane parameter on the camera frustum. :)

    I doubt this is a bug in Unity. Probably someone who knows more about Unity than I do (and that means virtually everyone else on the forum) could tell you what's going wrong. But getting one to respond can be difficult sometimes.

    Maybe you could edit the title for this thread and add the word "boobs" ...? ;)
     
  7. soundstone

    soundstone

    Joined:
    Jan 18, 2015
    Posts:
    4
    Yea, I was hoping it was something stupid like that. Seems otherwise though as the obvious answers have been ruled out. I appreciate your help hopeful.

    Maybe the answer is to start a new project and slowly bring in the assets again and see if I can find an issue in the code somewhere. I really don't want to do that, but if that ends up being my best option I might have to.
     
    hopeful likes this.