Trying to develop an AR app.When the app is opened,at that point the device location is (0,0,0) that is if I print or display my coordinates it will be (0,0,0).I want to create a starting point like at the entrance of a door.When other users using my app can open the app anywhere.
What I am trying to do is I already kept an AR at the entrance of the door.Users open app at random position which become their starting point, all AR objects will appear.When they pass through the AR object ,I want the coordinates of their device be(0,0,0).But if I run the below code in unity editor it takes the camera to the position where app has started.I am looking to convert the entrance position into App starting point.
Camera.main.transform.position=new Vector3(0,0,0);
From what I understand if we change the position of camera in app it can show glitches
Your question is very unclear -.-
but IF what you try doing is reset the camera to (0,0,0) while keeping all game objects at the same relative position to it you could try:
_
EDIT:
what the UGLY code above is supposed to do: it's going to crawl through all GameObjects and reposition them in such a way that if you set the camera to position (0,0,0) and facing (0,0,1), they will remain at the same position and orientation relatively to the camera.
notice that the camera itself WILL get repositioned to (0,0,0) and facing (0,0,1) after this code is executed because
Camera.main.transform.worldToLocalMatrix * localToWorldMatrix == identity
EDIT:
I can't put this code in the comments because it's too long.
try