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 Sophi · Nov 12, 2014 at 10:23 AM · androidaccelerometer

Accelerometer works on phone until build exe

Hello- I've got an Android phone which I am using the accelerometer to navigate around the game. The issue is that the accelerometer works perfectly until I build the game. Then the game doesn't pick up the accelerometer at all. I don't know where to start troubleshooting this.

edit: I am using Unity Remote on Android to access the accelerometer data. I am using a Windows box to run the game. The Android phone talks to the game via USB or wireless ADB. So the accelerometer data gets into the game easily in edit mode, but in build mode it no longer works. This is something that I wish Unity 3D would document on their website- does it work or not? If it isn't supported, why doesn't it talk? How can I make it talk? Anyone have any ideas? ~Sophi

Comment
Add comment · Show 10
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 HolBol · Nov 12, 2014 at 01:30 AM 0
Share

Are you sure you meant exe?

avatar image Sophi · Nov 12, 2014 at 01:37 AM 0
Share

Yes. It is a windows box. So when I do a build, it gives *.exe and a data folder.

avatar image HolBol · Nov 12, 2014 at 03:02 AM 0
Share

What platform are you targeting, specifically?

avatar image Graham-Dunnett ♦♦ · Nov 12, 2014 at 10:24 AM 0
Share

($$anonymous$$aybe @Sophi is using the Android remote, so can control the game running in the editor. A standalone build doesn't talk to the Android remote.)

avatar image Sophi · Nov 12, 2014 at 12:09 PM 0
Share

See edits to my question above. @Graham are you saying that Unity remote isn't supported in a standalone build? That seems misleading from Unity- that it works in edit but not in build?

Show more comments

3 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Bunny83 · Nov 12, 2014 at 02:09 PM

As mentioned in some comments, the Unity Remote application is only for testing in the editor and not a general purpose remote control which could be used in standalone builds.

However the answer from Unity (at least the part the OP quoted, maybe it's taken out of context):

It is not possible to use the android device as a controller for a standalone application outside of the editor

... is actually not true. You can't use the Unity Remote app since it's made for the editor. However you can create your own remote application with Unity that uses the Network interface to transmit any data you want to another application. Of course you have to develop that app, which data is transmitted and the data handling yourself.

So it is possible "to use your android device as controller for a standalone build", but not with the Unity Remote app.

ps: the source code for the Unity Remote is available for free on the Asset Store. However you need Unity pro to build it yourself since it uses Sockets. Keep in mind that you have to code the "receiving part" in your standalone application yourself.

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 Sophi · Nov 12, 2014 at 02:56 PM 0
Share

Thank you so much! I have Pro and have another standalone thing in my game that communicates over serial (bit banging), so I already have the "receiving part"!

avatar image
1

Answer by ashique · Nov 12, 2014 at 01:23 PM

Is Device supporting accelerometer???

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 Sophi · Nov 12, 2014 at 01:25 PM 0
Share

Yes. The device supports the accelerometer. It works perfectly in edit, just not in standalone.

avatar image
0

Answer by Sophi · Nov 12, 2014 at 01:08 PM

Got the official word from Unity 3D support: "It is not possible to use the android device as a controller for a standalone application outside of the editor."

I have to say that it is unfortunate that they allow you to access the accelerometer, gyro and camera in edit but not in build!

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 Bunny83 · Nov 12, 2014 at 01:59 PM 3
Share

How is the documentation misleading about the Unity Remote?

Unity Remote 4 is an application that allows you to use your target device as a remote control for your project in Unity editor.

First of all is says to use your "target device", so that means that you build for either Android or iOS. It also says to use the device as remote control inside the "editor". That it's for use in the editor is mentioned all over that page. For example:

When you use Unity Remote, the game actually runs in the Unity editor [...]

For short: Unity Remote is a development tool that simplifies testing of your project when targetting Android or iOS.

ps: The description of the Remote app itself is also quite clear.

avatar image Sophi · Nov 12, 2014 at 03:10 PM 0
Share

Yes you are right. I just read what I wanted to, but also it is counter-intuitive at least to me, that something wouldn't work in the build. I sincerely hope that there aren't other surprsies such as "transform" working differently in build than in editor! Also there are quite a few tutorials on youtube and such referencing the "use your phone as a controller!" Even universities give courses saying this. So...it is not clear to any of us...or we all just read what we want to. In any case, I now have a direction to go in for my custom controller and it is not Unity Remote!

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

7 People are following this question.

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

Related Questions

A node in a childnode? 1 Answer

accelerometer speed 1 Answer

3D: how to avoid jerks in a character movement using accelerometer 1 Answer

Unity for free commercial use ? 0 Answers

Android different resolutions in 3D (not GUI) 3 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