(Case 1353859) [Bug] ARFace script keeps adding empty gameObjects
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
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.
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
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?
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
A fix for this issue will be released in upcoming ARFoundation versions 4.2.2 and 5.0.0-pre.7.