Search Unity

ARFoundation reset Session double cycle?

Discussion in 'AR' started by Mephesto_Khaan, Oct 9, 2019.

  1. Mephesto_Khaan

    Mephesto_Khaan

    Joined:
    Jun 2, 2013
    Posts:
    47
    Hi all,

    Since there is no proper way to remove trackables I need to reset the ARSession, which I do simply with:


    Code (CSharp):
    1. Debug.Log("Reseting session");
    2. session.Reset();
    But I am also logging the status of the session with


    Code (CSharp):
    1. private void ARSession_stateChanged(ARSessionStateChangedEventArgs obj)
    2.         {
    3.             Debug.Log($"ARSession <b>{obj.state.ToString()}</b>");
    4.         }


    And I am getting

    Code (CSharp):
    1. Reseting session
    2. ARSession SessionInitializing
    3. ARSession SessionTracking
    4. ARSession SessionInitializing
    5. ARSession SessionTracking
    How comes that one reset is triggering 2? Something off internally?

    Edit: this is ARkit latest 3.0.0 preview. Sorry I did not archive it properly!