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 ZenDelta · Apr 30, 2013 at 11:36 AM · androidbutton

If-statement on GUI.Button won't work on Android

My last thread was closed cause of a duplicate i deleted before it was closed, so I try again..

I just tried to launch a game for Android-devices, but I got a major bugger that won't launch the game. As the title say, the if-statement for a GUI.Button to start the game won't work, it just stand on the same scene without doing anything. Is it a quick way to solve this? if(GUI.Button(new Rect(450,350,500,100),"Start game")) { Application.LoadLevel(1); }

Comment
Add comment · Show 6
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 Fattie · Apr 30, 2013 at 11:37 AM 0
Share

IN THE UNITY APPLICATION

OPEN "P{LAYER PREFERENCES"

LOO$$anonymous$$ AT THE$$anonymous$$

HAVE YOU FORGOTTEN TO INCLUDE THE RELEVANT SCENES ?

This is the third time someone has explained this

post a SCREEN SHOT of your player preferences "scenes in build"

avatar image fafase · Apr 30, 2013 at 12:02 PM 0
Share
 new Rect(450,350,500,100)

this sounds quite big to me for a mobile.

avatar image ZenDelta · Apr 30, 2013 at 12:02 PM 0
Share

https://dl.dropboxusercontent.com/u/4938568/Screens/ScreenShot052.png

Everything is included and it works fine when I run it in unity and on the unity remote app for android.

avatar image fafase · Apr 30, 2013 at 12:03 PM 0
Share

Also, make sure you do not hide useful members. You have a warning that tells you you are doing wrong.

avatar image Statement · Apr 30, 2013 at 12:36 PM 0
Share

How about a logcat? $$anonymous$$aybe you are getting some exception message? Just as a total sane check, also headbutt an Debug.Log in there to ensure the code is actually being called.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Fattie · Apr 30, 2013 at 12:52 PM

"the unity remote app......"

the remote app is utterly unrelated. it's just a mirror of your desk machine's screen.

You are using sizes too large - exactly as Fafase told you.

make it much smaller, try again, and let us know.

Comment
Add comment · Show 4 · 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 ZenDelta · Apr 30, 2013 at 01:51 PM 0
Share

Ok, what is the recommand size for a mobilebutton? :)

avatar image Fattie · May 03, 2013 at 06:57 AM 0
Share

simply try 100x100 as a test.

avatar image ZenDelta · May 08, 2013 at 02:41 PM 0
Share

It was the size! Thank for help :)

avatar image fafase · May 08, 2013 at 03:00 PM 0
Share

What I recommend is to use ratio.

Use Screen.height/ratio and Screen.width/ratio. This way you don't have to do one code for mobile phone, one other for tabs and even for each phone size you would have to...well you get the idea.

Using ratio, your box automatically gets sized according to the screen. You would have your font size doing the same as well (using integers).

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

15 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

Related Questions

Press Back Button Twice to Quit Game 0 Answers

Pls. Help how can I convert this script to be press using UI buttons. I want the vertical to be pressed and the for the horizontal I will make 2 arrows left and right. Thank you in advance 0 Answers

touch GUITexture Help 1 Answer

banner ad over a button, AdMob plugin problem 2 Answers

Button Focus Prevents Touch Raycast (Android C#) 1 Answer


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