Rotating object with Gear/Go controller touchpad (SOLVED)
Hello,
In Unity 2017.4 i had a script to rotate in object with the touchpad of the controller, Gear-vr and Go. I started a new project in Unity 2018.3 (oculus integration 1.34), and used te same script. But it doesn't work anymore. This is the script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class KE_ObjectRotation : MonoBehaviour
{
public GameObject ObjectToRotate;
Vector3 objRotation = new Vector3(0f, 0f, 0f);
public float objRotationSpeed = 60f;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
float TrackpadX = Input.GetAxis("Oculus_GearVr_DpadX");
if (TrackpadX != 0f)
{
objRotation.y += TrackpadX * Time.deltaTime * objRotationSpeed;
ObjectToRotate.transform.rotation = Quaternion.Euler(objRotation);
}
}
}
Anyone understanding the problem?
Anne
In Unity 2017.4 i had a script to rotate in object with the touchpad of the controller, Gear-vr and Go. I started a new project in Unity 2018.3 (oculus integration 1.34), and used te same script. But it doesn't work anymore. This is the script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class KE_ObjectRotation : MonoBehaviour
{
public GameObject ObjectToRotate;
Vector3 objRotation = new Vector3(0f, 0f, 0f);
public float objRotationSpeed = 60f;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
float TrackpadX = Input.GetAxis("Oculus_GearVr_DpadX");
if (TrackpadX != 0f)
{
objRotation.y += TrackpadX * Time.deltaTime * objRotationSpeed;
ObjectToRotate.transform.rotation = Quaternion.Euler(objRotation);
}
}
}
Anyone understanding the problem?
Anne
