Quantcast
Channel: Questions in topic: "ios"
Viewing all articles
Browse latest Browse all 4709

Accelerometer start position for iPhone

$
0
0
Hello, I finished a mobile game where I use the phone’s accelerometer to move the player. I found a solution to detect the phone start position to begin playing & it works fine when I build & run to test it on an android. But when I build & ran thru Xcode it only works when it is facing flat (landscape mode only). But when I test it thru unity remote it works fine on an iPhone. I’m not sure what to do from here. Here is my movement script. float accelStartY; void Start() { accelStartY = Input.acceleration.y; } void FixedUpdate() { transform.Translate(Input.acceleration.x, Input.acceleration.y - accelStartY, 0, Space.World); }

Viewing all articles
Browse latest Browse all 4709

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>