Search Unity

GameObjects disappearing when not viewed by any camera ... but not reappearing when in view

Discussion in 'Scripting' started by myates07, Jul 9, 2019.

  1. myates07

    myates07

    Joined:
    Jan 9, 2018
    Posts:
    2
    So I have a weird bug, and I don't really know how to wrap my head around explaining it because the cause of the issue seems foreign to what I've experienced with Unity. However, I'll do my best to go over what details I figure help coming to a solution:

    I have some basic GameObjects in my scene, and they are all NavMeshAgents with a couple really basic components attached for communicating with an AnimationController, and thats about it. The NavMesh has been baked for the scene (its a small scene with only a couple objects for development/testing) and the agents can navigate around perfectly fine. The NavMeshAgents also have Ragdoll functionality setup for them through the Unity Ragdoll wizard tools.

    With context provided, the issue is that when my NavMeshAgents are out of view of the 'Game' camera and the scene editor camera (the object isn't visible to any camera(s) present) - the object disappears, or what I imagine- the object is being culled; I say that because the object is still active in the scene and processing its logic, its just not being rendered. Now, before you say "its normal to be culled when not in any camera's view" - when the object comes back into any camera view, it doesn't reappear and instead stays culled. I know the object is still 'there' because if I have my Player object walk into it, the colliders act appropriately. The NavMeshAgents just aren't reappearing. I have to go into the scene editor (during runtime) and double click on the object to focus on it and only while the 'Game' camera isn't also 'viewing', or at least should be viewing, the object to have it reappear for when I aim the 'Game' camera back at it.
     
  2. palex-nx

    palex-nx

    Joined:
    Jul 23, 2018
    Posts:
    1,748
    Are you sure you dont have any thirdparty/custom components disabling objects as a custom culling solution?
     
  3. myates07

    myates07

    Joined:
    Jan 9, 2018
    Posts:
    2
    99% positive that there isn't anything in the scene set to do so. The third party component(s) I'm using in my scene are from https://assetstore.unity.com/packages/templates/systems/easy-character-movement-57985 (for reference, I'm using their BaseAgentController as a derived class, but nothing in there is set to cull or disable anything, only set animatorcontroller parameters).