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
1
Question by Anxo · Sep 23, 2010 at 10:33 PM · guibuttoniphone

Button does not work when another is active? iPhone

Hi,

I have a "fire" button,a very simple On GUI ... If(GUI.Button..., click bang! works well.

But I also have a joystick on the other side, that works via GUI texture iphone input touch.

while I am moving the character around with the joystick, the fire button does not register when I click it. only when I let go of the joystick can I fire.

any thoughts?

Comment
Add comment
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

5 Replies

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

Answer by Eric5h5 · Sep 23, 2010 at 10:40 PM

The OnGUI system currently has no support for multi-touch, although it probably should work in combination with other elements. It's best to leave OnGUI out of gameplay anyway for performance reasons (can still be used with menus OK).

Comment
Add comment · Show 1 · 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 Anxo · Sep 23, 2010 at 10:42 PM 0
Share

jesus that was fast, thanx for clearing that up, I will use a GUI texture to touch.

avatar image
2

Answer by Murcho · Sep 23, 2010 at 10:39 PM

Sounds like you only have single touch enabled. Check the iPhoneInput.multiTouchEnabled variable, and if it's false, just set it to true.

Comment
Add comment · Show 1 · 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 Mantas-Puida · Sep 24, 2010 at 08:43 AM 0
Share

Checking iPhoneInput.multiTouchEnabled won't help because OnGUI controls currently do not support mul$$anonymous$$ch at all.

avatar image
0

Answer by Dreamora · Sep 23, 2010 at 10:46 PM

Check out the iphone example projects in the unity3d.com - support - resources section, they contain code for input sticks etc tailored for the iphone.

Comment
Add comment · 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
0

Answer by sunnykhan4u21 · Jan 20, 2011 at 03:38 AM

have you solved this issue? because i am having the same problem

Comment
Add comment · Show 1 · 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 user-8467 (yahoo) · Jan 20, 2011 at 01:45 PM 0
Share

Sorry, not on my main account. Yes I use GUITexture Game Objects now ins$$anonymous$$d of OnGUI functions.

avatar image
0

Answer by Ouss · Jan 25, 2014 at 10:53 PM

Hi, In order to make the button clickable while moving with the joystick/or another button is active you need to manage the multi touch with TouchCount in the Update(), here a sample:

void Update(){

if(Input.touchCount > 0){

 for(int i = 0;i<Input.touchCount;i++){
             
     Touch touch = Input.GetTouch(i);
     if(touch.phase == TouchPhase.Began && buttonRect.Contains(new Vector2(touch.position.x,Screen.height - touch.position.y))){

//your code to execture

             }
             
         }
     }

}

Comment
Add comment · 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

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

1 Person is following this question.

avatar image

Related Questions

how to create buttons using iphone look and feel?? 2 Answers

iPhone Touch Screen? 2 Answers

Touch GUI texture to toogle animation 0 Answers

Checking if a GUI Button was initiated? 0 Answers

DrawTexture GUI iPhone 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