Hi everyone,
I’m kind of new to the world of AR/VR and have been having trouble getting the camera to act the way I intend it to. Basically, what I want to do is make the AR Camera teleport once it hits a collider.
The way it is set up is, I have a parent object containing a character controller, a rigidbody and a first person controller script. then I have a child object which is the camera, and that one only has the camera with the UnityARVideo and UnityARCameraNearFar scripts.
Now, I can make the teleportation happen in a non-AR environment in Unity by simply attaching a script with a trigger event that will move the camera and the parent object it’s under onto a different position on the world. However, when I try to translate this into a scene where I use ARKit, I cannot get the same behavior. My camera simply goes through the collider. Normally I would debug using the console, but since I am on the phone, I have no way of telling what is going on (which bring me to another question --is there a way to debug like this)?
Just to be safe, I tried a different configuration, getting rid of the parent object and attached all components to the AR Camera + a sphere collider to trigger the teleportation. I had no luck either.
I have a couple of suspicions as to why this doesn’t work. The first one is that since AR tracks position in both the real and virtual world, if I try to teleport, this might mess with the program since I have physical world coordinates… or something like that, right? Or maybe it is simply that I am missing some sort of component on the camera so that it triggers the event.
My second suspicion (and the one I think is probable the most accurate) is that the camera is moving around the space of the parent object. So, if I move around with the phone, the camera moves but the parent object stays in place. Therefore there is nothing to trigger the teleportation.
Could any of the above be right? Does anyone have any suggestions on how to get around this problem? Thanks a lot everyone!