learntoflutter / flutter_embed_unity

17 stars 3 forks source link

Intermittent Character Missing in Text when Implementing Unity in Flutter #25

Open GreejeshGajera opened 1 month ago

GreejeshGajera commented 1 month ago

Description

We are experiencing an intermittent issue where characters in specific words are missing when integrating Unity into a Flutter application. This issue has been observed sporadically and affects the text display within the app. The problem is illustrated in the attached image, where certain letters in words are not rendered correctly, resulting in incomplete words.

Steps to Reproduce:

1.  Open the Flutter app that integrates Unity.
2.  Navigate to the section where the Unity component is displayed.
3.  Observe the text within the Unity component.
4.  Note that some words have missing characters as shown in the attached screenshot.

Expected Behavior:

All text characters should render correctly and completely without any missing letters.

Actual Behavior:

Intermittently, characters in certain words are missing, leading to incomplete words being displayed.

Screenshot:

Issue_Image

Environment:

•   Flutter Version: 3.22.1
•   Unity Version:  2022.3.28f1
•   flutter_embed_unity: ^1.0.4
•   Device/OS: Android/Ios
•   Other Relevant Information: (Any other relevant details that might help in diagnosing the issue)

Additional Context:

•   The issue does not occur consistently and appears to be random.
•   We have verified that the text data being passed to Unity is complete and correct.
•   The issue is only observed after integrating Unity within the Flutter app.

Possible Cause:

We suspect that this might be an issue related to the rendering engine or a potential conflict between Flutter and Unity text rendering mechanisms.

Steps Taken to Troubleshoot:

•   Verified the completeness of text data before passing it to Unity.
•   Checked for any known issues or updates related to text rendering in both Flutter and Unity.

Request:

We would appreciate any insights or suggestions on how to resolve this issue. If there are any specific tests or debug logs needed, please let us know, and we will provide them promptly.

Feel free to customize the template further based on the specifics of your environment and any additional information you might have.

Minimum reproducible example (MRE)

No response

What platforms are you seeing the problem on?

No response

Devices

No response

Anything else?

No response

jamesncl commented 1 month ago

Thanks for the bug report, this does seem very strange. Not sure why this would happen - I'm also passing text to Unity to display in TextMeshPro but I haven't encountered this issue. Some questions:

jamesncl commented 1 month ago

Also, what language / region do you have set on the device?

GreejeshGajera commented 1 month ago
jamesncl commented 1 month ago

That's really strange. I'm not sure what could cause that. Have you tried the flutter_unity_widget package? I would be interested to see if the same problem happens with that package. It might help to narrow down where the problem is