0

There are no problems when I am testing it in the editor. However, one specific GameObject (which is a simple sphere object) covers texts while testing the game on Android. This object is scaled between certain values at runtime as well. The same object doesn't cover the texts created at runtime. Any idea why this happens?

Masea
  • 103
  • 2
  • 10
  • Check the shader on it. It sounds like the shader maybe different and being drawn last for some reason. – BugFinder Jul 12 '22 at 20:21
  • @BugFinder If you're asking the shader of the object, nope it has the default material. – Masea Jul 12 '22 at 20:38
  • In what mode is canvas scaler? If you activate the gameobject later, does this solve the problem? In what mode is Canvas? Have you tried to enable ARM64 in player settings? If you place another gameObject in the same position, is it also above the UI? What components does the sphere have? What is the position of the sphere? – iFralex Jul 12 '22 at 21:21
  • @iFralex There are more than a couple of Canvases in the scene at the moment. They all share the same characteristics though, so no problem. Canvas Scaler mode is set to Scale With Screen Size. Canvas' mode itself is set to Screen Space - Overlay. I just built with the ARM64 enabled, no help. Sphere has components such as collider, Mesh Filter, Mesh Renderer, and a certain script that has nothing to do with the issue. – Masea Jul 13 '22 at 10:11
  • The position of the sphere is at the center (0, 0, 0). One more thing though, the texts are not covered by the object for the first time I boot up the game app on mobile. But once it is scaled, it somehow starts covering the texts. I also put another object at the same spot, IT ALSO COVERS THE TEXTS. – Masea Jul 13 '22 at 10:11
  • Putting the camera to the perspective mode fixes it but it also makes texts in 3D space disappear and I also don't want perspective mode. – Masea Jul 13 '22 at 10:15

1 Answers1

0

I fixed it by changing the shader of the used font material to TextMeshPro/Mobile/Distance Field Overlay.

Masea
  • 103
  • 2
  • 10