Search Unity

Camera

Discussion in 'FPS.Sample Game' started by erik-akerfeldt, Nov 5, 2019.

  1. erik-akerfeldt

    erik-akerfeldt

    Joined:
    Jun 22, 2015
    Posts:
    6
    Im trying to disconnect from a game and then re-join the game with the client but are running into some problems:

    to reproduce on the standard github version:
    1 start server & start client and connect the client to the server
    2 "leave game" on the client / or / from the cmd run the disconnect command on the client side
    3 on the client side: cmd: connect 127.0.0.1 - conenct back to the server
    4. observe the crash!

    I keep running into this problem:

    687: EXCEPTION
    at (wrapper managed-to-native) UnityEngine.Component.get_gameObject(UnityEngine.Component)
    at UpdatePlayerCameras.OnUpdate () [0x00046] in D:\eget\FPSSample\Assets\Scripts\Game\Systems\PlayerCamera\PlayerCameraSystem.cs:111
    at Unity.Entities.ComponentSystem.InternalUpdate () [0x0003c] in D:\eget\FPSSample\Library\PackageCache\com.unity.entities@0.0.12-preview.24\Unity.Entities\ComponentSystem.cs:475
    at Unity.Entities.ScriptBehaviourManager.Update () [0x00001] in D:\eget\FPSSample\Library\PackageCache\com.unity.entities@0.0.12-preview.24\Unity.Entities\ScriptBehaviourManager.cs:83
    at PlayerModuleClient.CameraUpdate () [0x00001] in D:\eget\FPSSample\Assets\Scripts\Game\Modules\Player\PlayerModuleClient.cs:258
    at ClientGameWorld.LateUpdate (ChatSystemClient chatSystem, System.Single frameDuration) [0x00147] in D:\eget\FPSSample\Assets\Scripts\Game\Main\ClientGameLoop.cs:268
    at ClientGameLoop.LateUpdate () [0x0001e] in D:\eget\FPSSample\Assets\Scripts\Game\Main\ClientGameLoop.cs:901
    at Game.LateUpdate () [0x00028] in D:\eget\FPSSample\Assets\Scripts\Game\Main\Game.cs:658



    looks like the HandlePlayerCameraControlSpawn initialize is not happening properly on the second connect.
    The Initialize camera methods is executed on the client when the first connection to the server is made.
    But after disconnecting and reconnecting its not executed.

    Please help me solve this crash so that i can leave a server and re-join - its blocking my progress.
     
  2. AggressiveMastery

    AggressiveMastery

    Joined:
    Nov 19, 2018
    Posts:
    206
    I just tried this, compiled, ran a headless server, connected to it, dissconnected with the menu, reconnected, and then dissconnected from the console, and connected 127.0.0.1 without any errors or issues with the camera.

    However, I do have a boot.cfg in my main folder, that loads my menu level. load level_menu

    so when I disconnect, it would play with the camera.

    Let me delete that boot.cfg and see if I get that camera error...

    Seems to still work...

    Are you doing this with a stand alone build, or with the editor playing some part? The testing I did, the editor(unity) was not in use.
     
  3. erik-akerfeldt

    erik-akerfeldt

    Joined:
    Jun 22, 2015
    Posts:
    6
    Hi @AggressiveMastery,
    thank for helping me out.

    I also tried without the unity editor running. so just starting the autobuild.exe from the build folder and reproducing your steps above.
    I still get the crash.

    I build the autobuild.exe from utinty editor based on git version 147f4719b61c2857d342bc0722c88d165bab3378.

    building on win10...
    what more could cause this? Im using level_00
     
  4. AggressiveMastery

    AggressiveMastery

    Joined:
    Nov 19, 2018
    Posts:
    206
    What Unity Editor Version are you running? Anything besides 2018.f3/4 inst going to work without extensive troubleshooting. That was my initial guess, wrong editor version?