Unity - How To Disable Accelerometer?

OmarKhaled

I have a gameobject that uses accelerometer as control input and also touch input. Now the game would be very bad if both controls are active at the same time, so I need to disable and enable controls by a toggle but sadly, the toggle is in settings menu, while the gameobject is in the game/play, so to summarize this:

1 - Disable/Toggle Accelerometer and Touch

2 - Access GameObject from another scene

3 - How to save the state of the toggle(including the state of the controls)

Thank You

joreldraw

Your steps are wrong.

Just in setting menu save your variable to PlayerPref:

PlayerPrefs.SetInt("ControlMode", 0)); //Accelerometer
PlayerPrefs.SetInt("ControlMode", 1)); //Touch

In the other scene you read this value and just set in your control script a condition or similar over "ControlMode":

int currentMode = PlayerPrefs.GetInt("ControlMode"); 
if (currentMode == 0)
{
  //Accelerometer input control
}
else
{
  //Touch input control
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to disable Metal in Unity

From Dev

How to disable all Unity animations?

From Dev

How to decorrelate accelerometer data

From Dev

How to find a value for accelerometer?

From Dev

unity3d - Accelerometer sensitivity

From Dev

Unity 3D realistic accelerometer control

From Dev

unity3d - Accelerometer sensitivity

From Dev

How to disable super+space key in Unity?

From Dev

How to disable super+space key in Unity?

From Dev

How can I disable recent documents in Unity?

From Dev

How to disable Unity keyboard shortcut for Spread mode

From Dev

How do I disable the ALT hotkey in Unity?

From Dev

How to completely disable unity launcher in Ubuntu 16.04?

From Dev

unity 3d rotate the gameobject according to accelerometer

From Dev

unity 3d rotate the gameobject according to accelerometer

From Dev

C# Unity3D Scale using Accelerometer with Clamp

From Dev

what is gyroscope and Accelerometer and how it use in Android

From Dev

How to display a number using Accelerometer value

From Dev

How to use Accelerometer in cocos2dx

From Dev

How to identify backhand and forehand shot using accelerometer?

From Dev

How to plot graph for accelerometer sensor values in Android?

From Dev

How to get degrees by Accelerometer data (Java libGDX)

From Dev

Unity on 13.10: Ctrl + Alt resizes the window. How to disable this?

From Dev

Unity on 13.10: Ctrl + Alt resizes the window. How to disable this?

From Dev

How do I disable the Unity keyboard shortcut overlay?

From Dev

How to disable unity side panel after cairo-dock install?

From Dev

How do I disable "Lock screen" keyboard shortcut under Unity?

From Dev

Questions about how scene kit translations work, and accelerometer

From Dev

How can I read the accelerometer in my windows tablet with python?

Related Related

  1. 1

    How to disable Metal in Unity

  2. 2

    How to disable all Unity animations?

  3. 3

    How to decorrelate accelerometer data

  4. 4

    How to find a value for accelerometer?

  5. 5

    unity3d - Accelerometer sensitivity

  6. 6

    Unity 3D realistic accelerometer control

  7. 7

    unity3d - Accelerometer sensitivity

  8. 8

    How to disable super+space key in Unity?

  9. 9

    How to disable super+space key in Unity?

  10. 10

    How can I disable recent documents in Unity?

  11. 11

    How to disable Unity keyboard shortcut for Spread mode

  12. 12

    How do I disable the ALT hotkey in Unity?

  13. 13

    How to completely disable unity launcher in Ubuntu 16.04?

  14. 14

    unity 3d rotate the gameobject according to accelerometer

  15. 15

    unity 3d rotate the gameobject according to accelerometer

  16. 16

    C# Unity3D Scale using Accelerometer with Clamp

  17. 17

    what is gyroscope and Accelerometer and how it use in Android

  18. 18

    How to display a number using Accelerometer value

  19. 19

    How to use Accelerometer in cocos2dx

  20. 20

    How to identify backhand and forehand shot using accelerometer?

  21. 21

    How to plot graph for accelerometer sensor values in Android?

  22. 22

    How to get degrees by Accelerometer data (Java libGDX)

  23. 23

    Unity on 13.10: Ctrl + Alt resizes the window. How to disable this?

  24. 24

    Unity on 13.10: Ctrl + Alt resizes the window. How to disable this?

  25. 25

    How do I disable the Unity keyboard shortcut overlay?

  26. 26

    How to disable unity side panel after cairo-dock install?

  27. 27

    How do I disable "Lock screen" keyboard shortcut under Unity?

  28. 28

    Questions about how scene kit translations work, and accelerometer

  29. 29

    How can I read the accelerometer in my windows tablet with python?

HotTag

Archive