HI, i am trying to get movment of the OVRPlayercontroller with the gear VR trackpad

OK so im kind of new to unity, but i have been playing with Gear Vr now for a few weeks.

I have learned a few things, which has helped me ask the right questions; how do i use the trackpad to move?

I have played with the OVRPlayerController.cs and i have learned that what im trying to do is use this section of code here:

Vector2 primaryAxis = OVRInput.Get(OVRInput.Axis2D.PrimaryThumbstick);

if(primaryAxis.y > 0.0f)
MoveThrottle += ort * (primaryAxis.y * transform.lossyScale.z * moveInfluence * Vector3.forward);

if(primaryAxis.y < 0.0f)
MoveThrottle += ort * (Mathf.Abs(primaryAxis.y) * transform.lossyScale.z * moveInfluence * BackAndSideDampen * Vector3.back);

if(primaryAxis.x < 0.0f)
MoveThrottle += ort * (Mathf.Abs(primaryAxis.x) * transform.lossyScale.x * moveInfluence * BackAndSideDampen * Vector3.left);

if(primaryAxis.x > 0.0f)
MoveThrottle += ort * (primaryAxis.x * transform.lossyScale.x * moveInfluence * BackAndSideDampen * Vector3.right);

Vector2 secondaryAxis = OVRInput.Get(OVRInput.Axis2D.SecondaryThumbstick);

euler.y += secondaryAxis.x * rotateInfluence;

transform.rotation = Quaternion.Euler(euler);

But i cannot get movement at all, i can get movement by using this command:

if (OVRInput.Get(OVRInput.Button.DpadUp))
{
moveForward = true;
dpad_move = true;

Which makes the movement via a swipe motion, one small step at a time :confused:

But i can move fluid by using this command:

(OVRInput.Get(OVRInput.Touch.PrimaryTouchpad)) sadly this will only work in one direction

So i am really stuck, please can somebody help me get the track pad to move?

This is weeks on and im no where nearer being able to move foward backward :confused:

Thank you for your help

One thing to know about the trackpad on the HMD is that it’s swipe based (unlike the one on the gear vr controller). So no matter where you touch on it 0,0 will be reported until you drag from the original location. So if you touch in the center and then drag all the way right you will get 1,0. You have to drag to get any values.

Thank you very much for your reply, but its the gear vr controller im looking to walk with. I am baffled at what part of the script i need to use, I am thinkign that its active on playercontroller.cs by the looks of it, but somehow its not working, is it a bug or is there something i need to enable in the script mate?

thank you for your help, Still no closer to solving it lol

I suggest this:

2 Likes

Appreciate the recommendation!

The first line in your script change it to OVRInput.Axis2D.PrimaryTouchpad. Thumbstick is for the Rift.

2 Likes

This is the answer i was looking for all working fine now :slight_smile:

Most respect to you mate, thank you very very much for helping. This will help others

For anybody looking for this answer on the net, who is using gear vr controller with unity and cannot get the trackpad to walk just copy this and replace it with your version

3798934–319111–OVRPlayerControllerWORK.cs (15.8 KB)

2 Likes

nearly a year old but this helped me greatly thank you! so was the only thing changed in the original script that 1 line of code mentioned above? just starting out with VR development myself and trying to master the basics like walking and grabbing objects!

Many,many thanks!

Been trying to pull that code apart for a couple of days now. This works perfectly.