Tracking phone location relative to placed GameObjects
Hello,
I currently have an app that uses GoogleARCore to detect planes using a point cloud through the phone's camera, and then allows the user to tap on a plane to place a sphere Gameobject.
I have placed a Raw Image in my main canvas that is positioned in the bottom left corner of the first person camera, almost like a minimap. The Raw Image has a Render texture attached to it, and there is an overhead Camera with the Render Texture as its Target Texture, so that anything the overhead Camera sees is rendered onto the Raw Image.
My current problem is this: I need to display both the sphere Gameobjects and the location of the user relative to the sphere Gameobjects in the Raw Image. What I wanted was the overhead Camera to continuously follow the user's movement based on the phone's coordinates relative to the placed sphere Gameobjects. However through many Google searches, it seems that the Camera needs to follow a Gameobject itself.
How do I go about this? How do I get the app to detect that once a sphere Gameobject is placed, both it and another spawned Gameobject representing the phone show up under the overhead Camera? How do I spawn in a Gameobject representing the phone/user? How can I get the overhead Camera to continuously follow the user Gameobject? What C# code/scripts need to be written? I have a Main Controller script that does all the work of detecting the planes and placing the sphere Gameobjects, so I thought the code should go in there. Any and all help is appreciated. See the attached image for a screenshot of my hierarchy and relevant prefabs.
Your answer
Follow this Question
Related Questions
has anyone found a way to remove the Google Cardboard SDK built in android permissions? 2 Answers
Google Cardboard App not being 360 1 Answer
Stop Automatic Head Tracking on Google Cardboard,Google Cardboard Static View 0 Answers
GoogleVR / C# - How to, with the "pointer click": click 1 move a cube and click 2 move back the cube 0 Answers
Press M to enlarge the minimap 1 Answer