iPhone Location in AR

I’m trying to rotate actors that have been spawned via AR to always face the iPhone camera. I’m not sure what the phone is considered in code. Using the player pawn location gives the location of the phone when the AR session first starts.

I would have thought the phone persisted being the player pawn and location updated while running the session, but it appears not to be.

Using 5.2

Just rotate them to face the camera?
That’s never going to fail…

How would I get the camera location? This is not a BP that has a camera component

Ended up using DeprojectScreenPositionToWorld using the player controller.

Not sure this is the best or only way so if anyone has a better way, let me know hah

But how is it not?
The viewport/camera is the physical phone.

Your comment replys lack any real substance. I am 100% aware that the camera/viewport is the physical phone. If the AR session had something like “GetPhoneLocation” then that sounds like it would be a better or more “proper” way. Either way, I have it working

You always have access to the camera and it’s vectors since it’s how a scene is rendered.
It’s part of/aaccessible from any controller with a little digging.
Surely they did not change this for the AR, because the t hey can’t. It’s part of the very basics of the engine…

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.