Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
2
Question by BugFighter · Oct 08, 2016 at 11:43 PM · c#canvasupdatejoystickandroid sdk

Cannot activate GameObjects in Inspector because of a script?

A few months ago I set up the "Mobile Single Stick Control" from the Standart Assets. I got it fully worked out. Today I updated the Android SDK. Since then, all the children of the Canvas that my joystick is child of are disabled and cannot be enabled (by ticking the checkbox in the Inspector). I have narrowed it down to the MobileControlRig.cs-Script – attached to the Joystick by default – that I have attached to the canvas.

If I disable the script (or attach it to the Joystick), I can activate all the UI GameObjects but the Joystick doesn't move the character. If I have the script enabled, all my UI is disabled including my Joystick. I am sure this only happened because of the SDK update since I have another computer with the exact same setup (exept for the sdk) and the stick works perfectly fine with the script attached to the canvas.

Now I can't get the Joystick to work. I really need help with this one because I can't really continue working on the project without being able to test it.

Thanks in advance.

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

3 Replies

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

Answer by Cynikal · Oct 30, 2016 at 06:50 PM

Per the code of MobileControlRig.cs:

 private void CheckEnableControlRig()
         {
 #if MOBILE_INPUT
         EnableControlRig(true);
         #else
             EnableControlRig(false);
 #endif
         }
 
 
         private void EnableControlRig(bool enabled)
         {
             foreach (Transform t in transform)
             {
                 t.gameObject.SetActive(enabled);
             }
         }

also from the same script:

         // this script enables or disables the child objects of a control rig
         // depending on whether the USE_MOBILE_INPUT define is declared.
 
         // This define is set or unset by a menu item that is included with
         // the Cross Platform Input package.


So, if you have your canvas as a child, and EnableControlRig is false, then it'll disable it all.

You need to enable Mobile Input Mode. If you have imported the cross platform input, you should see a menu item called "Mobile Input", and you should have it as enabled.

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 BugFighter · Nov 01, 2016 at 08:36 PM 1
Share

Thank you for your help, you were really close to the solution.

It has been activated (has always been) BUT after deactivating and activating again Unity warned that the Platform has not been set to a mobile platform. After switching back to Android it worked like a charm.

It is just strange why the platform was set to PC/$$anonymous$$ac/Linux since I never changed it... $$anonymous$$ust have been after the update or so.

avatar image
0

Answer by wmarker · Jan 28, 2018 at 05:25 AM

On reason may no longer enable GameObject is if you restore / import an entire Mobile-specific project through "Collaborate".

strong text The "new" project's build settings return to the default of Standalone. Since Standalone does not have mobile inputs, they are disabled, with an open / non-tickable checkbox in the Inspector.

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 sdanialnasir1 · Jul 03, 2018 at 08:59 AM

Hello friend . i am facing the same issue please guide me to solve that

Comment
Add comment · Show 2 · 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 parm88 · Aug 05, 2018 at 12:57 PM 1
Share

$$anonymous$$obile joystic can't be enabled unless you switch the platform in build settings.So switch the platform before activate mobile joystic in build settings.

avatar image ramtekkar42 · Apr 01, 2020 at 03:28 PM 0
Share

Solution is simple. you have to switch to Android or iOS platform from Build Setting .

Problem is you are trying to access the joystick on non mobile platform.

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

62 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 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 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

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

How can I set the anchor tags to the center of it's own rectTransform rather than the parent's rectTransfom? 1 Answer

Why isn't a function being called by my boolean? 3 Answers

Pause Menu Text Not Rendering 0 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