- Home /
This post has been wikified, any user with enough reputation can edit it.
Compass.rawVector returns zero vector on GalaxyS4
I have used script below
void OnGUI() {
GUILayout.Label(Input.compass.rawVector.ToString());
}
It returns zero vector on screen.I don't understand why it doenst work.Compass works well in tests of the phone.
Unity Version: 4.5.5f1 Phone:Samsung Galaxy S4 Andoroid Version:4.4.2
Comment
Best Answer
Answer by WFW · Nov 02, 2014 at 08:35 AM
My problem is solved thank you. I added the lines below to start function.
Input.location.Start();
Input.compass.enabled=true;
from http://docs.unity3d.com/ScriptReference/Compass-enabled.html
Your answer
![](https://koobas.hobune.stream/wayback/20220613170526im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Smooth movement when input is pressed 1 Answer
Quaternion amount/value of rotation? 2 Answers
Drag-and-drop dot on mobile 2D 0 Answers
Can't move player with rigidbody.velocity 1 Answer
How to prevent Z axis rotation ? 0 Answers