GetGyroscope

public static Vector3 GetGyroscope(int playerId);
public static Vector3 GetGyroscope(VPlayer player);

Description

using UnityEngine;
using Volplane;

public class Demo : VolplaneBehaviour
{
    private int playerId = 0;
    private bool started = false;

    void OnConnect(int id)
    {
        playerId = id;
        started = true;
        TrackingControllerMotion(playerId, true);
    }

    void Update()
    {
        // Write gyroscope data to console
        if(started)
            Debug.Log(VInput.GetGyroscope(playerId));
    }
}

Returns a vector representing the controller orientation (alpha, beta, gamma). Only returns valid data if actively tracking motion data (TrackingControllerMotion()).

 

 

playerId The player identifier.
player A player object.