Forum Discussion
Anonymous
8 years agoOculus Go - character movement using touchpad press, in unity3d?
my end goal is to be able to move character forward, backward, and strafing left and right by detecting where you are touching on the touchpad and if you are pressing in on the touchpad (and not just touching it).
using something like if OVRInput.Get(OVRInput.ButtonTouchpad); to see if you are pressing in on the touchpad.
also OVRInput.Get(OVRInput.Axis2.PrimaryTouchpad); to see where you are touching, and then setting up values that will move you in the proper direction.
i am pretty new to unity and game development. but if anyone could help me wrap my head around how to set this up it would be much appreciated. to at least get me on the right track.
using something like if OVRInput.Get(OVRInput.ButtonTouchpad); to see if you are pressing in on the touchpad.
also OVRInput.Get(OVRInput.Axis2.PrimaryTouchpad); to see where you are touching, and then setting up values that will move you in the proper direction.
i am pretty new to unity and game development. but if anyone could help me wrap my head around how to set this up it would be much appreciated. to at least get me on the right track.
4 Replies
Replies have been turned off for this discussion
- LonelyTerminatoHonored GuestHave you figured This out? I want the exact same locomotion as you, so far i'm only able to take a step everytime I swipe in the direction I want to go but I'd love to be able to move freely with the touch presses in the direction I want to go because I have to tell you swiping to get everywhere in my game has to change haha
- radicalappdevProtegeI found a simple way to do this. It's far from perfect and needs to be refined, but it's good enough for me to get started.
I used the CameraRig. Make sure to drag the camera rig and center eye objects into the slots in the inspector.public class PlayerMove : MonoBehaviour
{
public float moveSpeed = 10.0f;
public GameObject cameraRig;
public GameObject centerEye;
private Vector2 touchpad;
void Update()
{
//Player movement
touchpad = OVRInput.Get(OVRInput.Axis2D.PrimaryTouchpad);
transform.eulerAngles = new Vector3(0, centerEye.transform.localEulerAngles.y, 0);
transform.Translate(Vector3.forward * moveSpeed * touchpad.y * Time.deltaTime);
transform.Translate(Vector3.right * moveSpeed * touchpad.x * Time.deltaTime);
cameraRig.transform.position = transform.position;
}
} - oculusgoturnerHonored Guest
- pedromasaHonored Guest@radicalappdev I tried just the same as you but I cant make it work... This is going to make me crazy.Could you help me?
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 4 years ago
- 10 months ago