arfoundation-samples icon indicating copy to clipboard operation
arfoundation-samples copied to clipboard

(Case 1353859) [Bug] ARFace script keeps adding empty gameObjects

Open AdrienMgm opened this issue 5 years ago • 5 comments

Unity bug report case number (Case 1353859)

Hello,

I already filled a closed bug #845 but now it is attached to a Unity bug report! 😀

We are working on a simulation tool to simulate face tracking (ARFace) in editor and we are facing an issue with the instantiation of new unreferenced gameObjects.

Describe the bug Each time an ARFace is added three new gameObjects are created in the scene and never destroyed even if the ARFace is destroyed by the ARFaceManager.

Below the code that creates the issue:

internal void UpdateEyes()
{
    if (leftEye == null && rightEye == null && fixationPoint == null)
    {
        leftEye = Instantiate(new GameObject(), transform).transform;
        rightEye = Instantiate(new GameObject(), transform).transform;
        fixationPoint = Instantiate(new GameObject(), transform).transform;
    }

    UpdateTransformFromPose(leftEye, sessionRelativeData.leftEyePose);
    UpdateTransformFromPose(rightEye, sessionRelativeData.rightEyePose);
    fixationPoint.localPosition = sessionRelativeData.fixationPoint;
}

As we can see in addition to instantiate a leftEye, rightEye and a fixationPoint we also create three unreferenced and empty new GameObject() so they are never destroyed.

Expected behavior Only instantiate needed objects and destroy them with an ARFace without leaving empty gameObjects in the scene.

Environment : Unity Editor 2019.4.24f1 ARFoundation 4.1.7 ARKit 4.1.7 ARCore 4.1.7

AdrienMgm avatar Jul 28 '21 11:07 AdrienMgm

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 23 '21 11:09 stale[bot]

Hello, I have the exact same issue with the same environment and it is bothering our team workflow. Is there any update yet ? Thanks in advance

Lchikar avatar Sep 27 '21 15:09 Lchikar

Hi. I agree this looks like a bug, but I'm curious what sort of workflow problem a couple of empty GameObjects creates. Can you elaborate?

tdmowrer avatar Sep 27 '21 17:09 tdmowrer

I wouldn't call it a problem really, it's just annoying when we add an ARFace (which is very recurrent in our project) and I am being polluted by unwanted GameObjects quickly flooding the hierarchy.

I know it's not a top priority, but if you have time to look at it it would be great

Lchikar avatar Sep 28 '21 16:09 Lchikar

A fix for this issue will be released in upcoming ARFoundation versions 4.2.2 and 5.0.0-pre.7.

ankur-unity avatar Dec 02 '21 23:12 ankur-unity