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

1 Answer 1

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\$
1
  • \$\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, 2016 at 9:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .