0
\$\begingroup\$

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?

\$\endgroup\$
  • \$\begingroup\$ If someone has a better title for this, I would be happy to change it ._. \$\endgroup\$ – TobiasW Apr 20 '16 at 7:12
  • \$\begingroup\$ 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. \$\endgroup\$ – Uri Popov Apr 20 '16 at 7:20
  • \$\begingroup\$ Yeah thats exactly how I did it later on, thanks :) \$\endgroup\$ – TobiasW Apr 25 '16 at 6:37
0
\$\begingroup\$

u need Input.gyro.userAcceleration

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

\$\endgroup\$
  • \$\begingroup\$ 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? \$\endgroup\$ – TobiasW Apr 20 '16 at 9:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.