- Home /
This line of code works in the editor, but not on my android device
Here is the code that works in the Editor, but when I build and install the apk on my S4, it doesn't work.
distanceTraveled = (int) Mathf.Abs(transform.localPosition.x);
label.text = distanceTraveled.ToString();
It could be that it is being render outside the view of your mobile device. I knew this was annoying when I realized this.
@cdrandin, I am using dfgui and the label is in the view but it isn't changing.
Answer by cdrandin · Jul 24, 2014 at 12:02 AM
try making it some static string(i.e label.text = "BLAH TEST";
just to see what is going on
Okay so it still doesn't change it to the string, so it has to be a problem with dfgui
I think it might be this warning I wasn't aware of before about inconsistent line endings.
It seems so. Try creating a gui text independent from that software and see if that gets displayed.
I can't figure it out. I converted the line endings but it still doesn't work.
What is baffling is that it works inside the unity editor, but not inside my device.
I am not sure what software you are using. I tried searching dfgui, but found a bunch of different things. Um, I would double check the documentation. $$anonymous$$ake sure all require components are in the scene. If they have a forum for there software check that.