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

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! Your feedback helps others to see the most helpful information.