|
Below my code to control a marbel object that is also capable of jumping/bouncing by adding vertical force via accelerometer. This works but with a problem related to Portrait and PortraitUpsideDown. Seems PortraitUpsideDown messes somehow with AddForce in global y (accelerometer axis z = global axis y). While in Portrait orientation control behaves as expected on all axis, but with PortraitUpsideDownBelow forces in global y seem to be much smaller. Thus the object (e.g. ball) doesn't jump high enough in PortraitUpsideDown Orientation. Forces along global x/z seem to be correct and reasonable for both orientations. It's worth to say that I don't autorotate during gameplay but fix the autorotation in a previous scene (menu). I can't get why there is an anomaly with forces along global y axis and already willing to say this is a unity bug. Anyone run into this or see an error in the code?
(comments are locked)
|
|
After continued tests it appears not to be a Unity bug nor a user script error, but it's hardware specific (iPad). I suspect the position of the accelerometer not centered in the iPad thus the momentum when trying to jump/bounce the ball is quite different depending on how the device is held (Portrait or PortraitUpsideDown). This results in a inconsistent/confusing jump-behaviour of the ball. Very bad for marble/ roll the ball games with a jumping ball on iPad, unfortunately. On other (smaller) devices it seems to be ok.
(comments are locked)
|
