- Home /
Can't get World to Viewport sqpace working with AR Foundation Camera ?
Hi everyone,
So I'm doing an app using AR Foundation and am trying to put a simple text label in 2D using it's rectransform anchors based on an object on the scene.
The usual way to do the stuff is to get Camera.main and just do a simple conversion WorldToViewportSpace there.
This is working as usual in editor mode if I take the camera and move by using the editor handles just to mimick what could happen in AR. I also moved the object in and out of frame and it's also working.
Now the issue is that when I try to put it on my ios device, the label is in view and literally nothing happens.
So I've tried to do a 3d label in World Space and have it facing the camera but it's also not rotating.
It's like the camera is not selected or something. So then I tried to debug with a simple debut text how many cameras are there in the scene and the debug says only one, and it's the name of my main camera.
I also tried to access the camera by doing a FindObjectOfType<.ArSessionOrigin>().camera just to be absolutely sure but still not working. (sorry about the formatting, the < tag is not helping so I had to add the dot!)
I don't know what is really happening with the AR Foundation camera but yeah, I can't figure out why nothing is working.
If someone has any idea it's really welcomed. Thanks !
Your answer
Follow this Question
Related Questions
AR Foundation device camera flickering 0 Answers
Android Unity ARCore camera access 0 Answers
Object/Landmark Tracking using mobilephone Camera 1 Answer
Color detection in Camera 0 Answers