And by 2D Objects, I mean TextMeshPro and Particle System.
As you can see, the numbers appear in reverse and some lost almost its body. The problem goes the same way with particle system.
But if I set my camera correctly (in straight line with the object), it do appear.
I dont know how to begin to fix this. I have tried several solution but still it won’t work.
-
Add to the text
OverlayText.transform.LookAt(Camera.main.transform);
-
Add to the text
OverlayText.transform.rotation = Quaternion.LookRotation(Camera.main.transform.position - transform.position);
I will be really appreciated with any helps!. Many thanks!
Updated: Using
OverlayText.transform.LookAt(Camera.main.transform);
OverlayText.transform.RotateAround(OverlayText.transform.position, OverlayText.transform.up, 180f);
the text has the correct rotation, but there are still some lost their body and if I set the view for my camera wrong, other text will lose their body too.
This question has nothing to do with AR in principle. I recommend that you practice just spawning your text in a regular 3d scene in the Editor? This may be an issue with how your prefabs are set up or something. There is nothing unique about the AR camera vs any other camera in Unity with respect to Transform.LookAt