How to implement walking in Gear VR?

I’m working on a Gear VR project and want to implement walking. What I need is, when the person wearing the device walks , it should have same effect in the virtual world.

For this i used Input.acceleration and input.gyro.useracceleration.

In the UpdateMovement method of OVRPlayerController.cs,

bool gyro = false;
float acceleration = Mathf.Abs(Input.acceleration.z);

        if (acceleration > 0)
            gyro = true;
        else
            gyro = false;

However, with both Input.Acceleration and Input.Gyro, the character moves continuously even when the person is standing still.

Any help would be great. Thanks

Uh… I don’t know what you mean.

The Gear VR can’t detect whether a person is walking or not. For that, you’d need something like a pedometer device (although you might be able to hack an estimation via the built-in motion sensors, to determine head bobbing up and down and the like to determine when steps are being taken)

For that matter, it would be an exceedingly bad idea – people will walk into things, trip over things. Guaranteed injuries…

[Having said all that – it is also bad to have joystick-controlled walking in VR… totally induces vertigo and nausea. The way I implemented walking is to trigger a walk event if you look at a certain location for a couple of seconds. You can try out the demo for Oculus at: www.VirtualRogue.com ; Another way to do it is to use a single button – say the Gear touchpad – and you walk in whatever direction you are facing so long as that button/trigger is held down.]

1 Like

@guru20 thanks. I ended up implementing single tap event that moves forward in whichever direction the person is facing. We want to implement pedometer as this is a tech demo. Working on it.