'GameObject is not staying on position AR foundation worldspace
I created a simple GameObject with AR GroundPlane and every time I call the function it creating a new GameObject on AR WorldSpace. The problem is when I create GameObject that visible on AR Camera and trying to move the AR Camera the GameObject is moving too. I want to stay the GameObject on where I assign it on AR worldspace. I've been searching about this problem but no luck.
private void createObject()
{
count++;
GameObject gm = Instantiate(cube, placeMentPose.position, placeMentPose.rotation);
gm.name = "cube" + count;
gm.GetComponent<LeanPinchScale>().enabled = false;
gm.GetComponent<LeanTwistRotateAxis>().enabled = false;
gm.GetComponent<LeanDragTranslate>().enabled = false;
gm.AddComponent<ARAnchor>();
gm.transform.GetChild(0).name = gm.name;
spawnObject.Add(gm.name, gm);
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
