# Unity move canvas slightly with smartphone acceleration

I'm developing an AR-App with the Samsung-GearVR. To get a smooth UI, I thought about creating a UI, which is not completely fix, I thought it could be nice, when the UI is slightly behind my head movement, but still lerps to the correct position, when my head is not moving. (A lot of 2D-Sidescroller got this style of camera, which is not fixed on the character, but instead is following the character with a bit of delay, I want this effect for my canvas.)

First off I changed my canvas to World space, which works fine, then I was thinking about the Input.acceleration method, but it does not really give you the actual acceleration, but the actual rotation of the phone. Now I'm struggling, because I don't know, how to get the current acceleration. Is there some better way to achieve this effect or do I have to build something with the Input.acceleration method?

• If someone has a better title for this, I would be happy to change it ._. – TobiasW Apr 20 '16 at 7:12
• I have a question. When you move your head around do you have a object that moves in world space from that movement. Something like a parent object for the cameras or something like that. If you have such a object why not delay lerp the canvas to that objects position. – Uri Popov Apr 20 '16 at 7:20
• Yeah thats exactly how I did it later on, thanks :) – TobiasW Apr 25 '16 at 6:37

Edit: for some Android devices I had to manually call Input.gyro.enabled = true; not sure if it's the same for Samsung-GearVR

• Okay, this gives me the acceleration, do you know, with which of these values I would use to get the horizontal acceleration and move my canvas in x-axis? – TobiasW Apr 20 '16 at 9:25