Please Select Your Location

Thailand
Australia
Österreich
België
Canada
Canada - Français
中国
Česká republika
Denmark
Deutschland
France
HongKong
Iceland
India
Ireland
Italia
日本
Korea
Latvija
Lietuva
Lëtzebuerg
Malaysia
Malta
Mexico
Nederland
New Zealand
Norge
Polska
Portugal
Russia
Saudi Arabia
Singapore
Southeast Asia
España
Suisse
Suomi
Sverige
台灣
Ukraine
United Kingdom
United States
Việt Nam
المملكة العربية السعودية (Arabic)

How do I set the controller position in a rotation-only environment?

WaveVR uses the Controller Loader to load the controller in runtime. Therefore, the controller position cannot be modified in Editor.
Select Track Position to track the position of the controller.
Note: If Track Position is not selected, the controller will be set to rotation-only.

Go to Set the rotation-only position of the controller in runtime (sample code) to learn how to set the rotation-only position of the controller.

Set the rotation-only position of the controller in runtime (sample code)

Follow the steps below to set the rotation-only position of the controller.
  1. Listen to the CONTROLLER_MODEL_LOADED broadcast to receive the controller instance.
  2. Set the position of the controller instance.
    private GameObject dominantController = null, nonDominantController = null;
    void OnEnable()
    {
        WaveVR_Utils.Event.Listen (WaveVR_Utils.Event.CONTROLLER_MODEL_LOADED, OnControllerLoaded);
    }
    
    void OnControllerLoaded(params object[] args)
    {
        WaveVR_Controller.EDeviceType _type = (WaveVR_Controller.EDeviceType)args [0];
        if (_type == WaveVR_Controller.EDeviceType.Dominant)
        {
            this.dominantController = (GameObject)args [1];
            // Set to (0, 0, 0)
            this.domintController.transform.localPosition = new Vector3 (0, 0, 0);
        }
        if (_type == WaveVR_Controller.EDeviceType.NonDominant)
        {
            this.nonDominantController = (GameObject)args [1];
            // Set to (0, 0, 0)
            this.noDomiController.transform.localPosition = new Vector3 (0, 0, 0);
        }
    }
    
    void OnDisable()
    {
        WaveVR_Utils.Event.Remove (WaveVR_Utils.Event.CONTROLLER_MODEL_LOADED, OnControllerLoaded);
    }
Submit
Thank You!