Quantcast
Channel: Questions in topic: "xcode"
Viewing all articles
Browse latest Browse all 1047

Accelerometer input working in Unity Remote, not working in build.

$
0
0
Hey guys, My accelerometer input works fine when I run my game through Unity remote, but doesn't work when I build it through XCode and run it on my iPhone that way. Here is my code, any help is highly appreciated! if (ButtonPositions.UsingAccelerometer) { moveX = 0; iPx = Input.acceleration.x; if (Mathf.Abs(iPx) > 0.2f) { moveX = Mathf.Sign(iPx); if (moveX > 0) { MoveRight(); } else if (moveX < 0) { MoveLeft(); } } else { myTransform.rigidbody2D.velocity = new Vector2(0, myTransform.rigidbody2D.velocity.y); } if (Input.touchCount > 0) { Jump(); } } Thanks!!

Viewing all articles
Browse latest Browse all 1047

Trending Articles



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