I need to create an a furniture dropping app. While I have managed to figure out how to rotate scale the object and detect planes in AR world, I also need to enable the users to be able to choose from a list of furniture, add multiple furniture into the scene and also delete them as when they like. I can't seem to find any tutorials that teach this. There are plenty with ViewAR and Vuforia but since it is a school project, I am restricted to using the ARKit plugin in Unity. Any help in this would be highly appreciated!
So currently what I am doing is, I create an empty gameObject to which I attach a script that has the function call AddObject which is as such:
public void AddObject()
{
GameObject summonedFurni = Instantiate(prefab);
summonedFurni.transform.position = new Vector3 (0f, 0f, 0f);
summonedFurni.transform.localScale = new Vector3 (10f, 10f, 10f);
summonedFurni.AddComponent<Rigidbody> ();
furniList.Add (summonedFurni);
//summonedFurni.SetActive (true);
}
Each type of furniture is a separate gameObject to which the script is attached to. However, firstly the instantiated objects can't detect the plane and fall right through it. Adding a BoxCollider component simply causes all the furniture to stack up above me in the real world. Also I am unable to delete any objects from the scene as I am unable to keep track of the created objects. Any advice on this?