iPhone reverse tilt control

Hi everyone,

I’m a very newbie at Unity. I created a 3DRT walk into a small gallery. I first used the “First Person Controller” which can be found in the Mobile Asset. I can use Unity Remote to test the joystick, I’ve been able to build and to install the application with Xcode on my iPhone (V1) and my iPad.

Then, I tried with the “First Person Tilt Controller”, (in mobile asset too).

I tested it in unity with Unity Remote on my iPhone and on my iPad, works perfectly, but, when I build and install the app for real on my iPhone or iPad, everything that works with the accelerometer is reversed (tilting the device to the left gives me a rotation of the camera to the right, same thing with the up and down control, tilting the device down rotates the camera up)

Am I doing something wrong? Because it works fine in the Unity Game window with the same iPhone/iPad using Unity Remote and nothing is reverse.

I’ve been able to reverse the control into Unity, so that if I tilt the device to the left, the camera rotates to the right. I tested it on my iPhone, nothing changed, same problem, tilting left, camera goes right (like in unity now…)

Hi, welcome to the forum!

Can you post the code you are using to check the accelerometer (ideally the whole function)?

I can, but I use the prefab in mobile Asset. It says that if I don’t set up a joystick or touchpad for the camera, it automaticaly uses the accelerometer, so I didn’t code anything new.

I tried with my own scene, but also with a “test scene” from unity (those that shows you a white grid on a black plane on which you can walk to see how the whole thing reacts with the iPhone, same problem, it works right in Unity with Unity Remote, but when trying with the installed app, it goes reverse when tilting the device.

Additionnal informations if needed:

I work with the latest build of Xcode (updated on tuesday) for iOS 4.2.
I got the latest version of Unity 3D in trial mode (I’m currently testing unity for a school project).

I test with an iPad (4.2.1 jailbroken) and on an iPhone V1 (3.1.3 also jailbroken). I will also try on an iPhone 4 (guess what, also jailbroken :wink: ) today or tomorow.