Hi !
I'm currently coding a game with my team, and we have a strange problem.
At some point, we need to draw a line from point A to point B gradually. I works great on every devices we own, except from the iPhone 5 (iOS 10.2.1) and the Ipad (1st gen, 9.3.5) (works on iPhone 6).
The problem is that on this devices, the line starts to "draw", but after the first "update", it stops, leaving the line incomplete (no error, and the game works well). At first, we used a DIY solution based on "while" and calculations, so we tried using Lerp, same issue.
That's really strange... As someone ever encounter this problem?
EDIT : added code for the drawing
GameObject line_tmp = Instantiate(line_fig_prefab);
line_tmp.GetComponent ().SetPosition (0, pos_line_end);
line_tmp.GetComponent ().SetPosition (1, pos_line_end);
float t = 0f;
while (line_tmp.GetComponent ().GetPosition (1) != end_pos)
{
line_tmp.GetComponent ().SetPosition (1, Vector3.Lerp(pos_line_end, end_pos, t));
t += 0.05f;
yield return null;
}
EDIT 2 : Finaly found why. On old Apple devices (iPhone 5, iPad 1, ...), the texture needs to be POT sized (16x16, 32x32, ...). Thanks Harinezumi for your help !
↧