- Home /
problem with Text UI when debugging on android
So basicaly this is the line that is causeing problems:
LivesToBeShown = dummy.GetComponent [Text] ();
(interchange [] for <>)
dummy is a gameobject and LivesToBeShown is Text object. When it comes to this line when running on computer, game runs perfectly. But when im testing on my android device (samsung galaxy j5 2017), it fails (as in the game stops running. Doesnt force quite, just stops going through any more lines of code).. Anybody have an explentation? I know im giving very little info but trust me... this is all thats needed and is definatly to do with this line
oh and theres no errors in the log which is the other weird thing. So it just seems to freeze
Answer by leSamo · Jan 06, 2018 at 08:28 PM
This line is unreliable:
LivesToBeShown = dummy.GetComponent();
Try changing it to :
LivesToBeShown = dummy.GetComponent<Text>();
sorry dont know why it didnt paste properly cause thats what I have!
Your answer
Follow this Question
Related Questions
When using unet to spawn players, the player object is invisible, but colliders present. Help 0 Answers
Unity 5.4.0f3 Personal - UI not updating after Build. 1 Answer
How to get IsPointerOverGameObject(touchID) object reference 0 Answers
prefabs inside content area not fitting entire width of content area? 0 Answers