Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by kamuzai1226 · Jul 23, 2014 at 11:55 PM · mobilemathfcasttostring

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();
Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image cdrandin · Jul 23, 2014 at 11:56 PM 0
Share

It could be that it is being render outside the view of your mobile device. I knew this was annoying when I realized this.

avatar image kamuzai1226 · Jul 23, 2014 at 11:58 PM 0
Share

@cdrandin, I am using dfgui and the label is in the view but it isn't changing.

1 Reply

· Add your reply
  • Sort: 
avatar image
2

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

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image kamuzai1226 · Jul 24, 2014 at 12:23 AM 1
Share

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.

avatar image cdrandin · Jul 24, 2014 at 12:24 AM 0
Share

It seems so. Try creating a gui text independent from that software and see if that gets displayed.

avatar image kamuzai1226 · Jul 24, 2014 at 12:52 AM 0
Share

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.

avatar image cdrandin · Jul 24, 2014 at 12:59 AM 0
Share

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.

avatar image kamuzai1226 · Jul 24, 2014 at 01:16 AM 0
Share

daikon forge gui.

I'll do that though thanks.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

22 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

GUITexture is lagging my object 0 Answers

how to translate key input controls to touch controls? (For Mobile gaming) 1 Answer

rotate camera on mobile 1 Answer

How to find the gender of the user for a mobile build? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges