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 show or hide the controller pointer?

The WaveVR controller pointer is created by WaveVR_ControllerPointer.cs and is shown by default. You can choose to show or hide the pointer in runtime.
Note: WaveVR EventSystem is not affected even if the pointer is hidden.

Go to Show or hide the controller pointer (sample code) to learn how to show or hide the controller pointer.

Show or hide the controller pointer (sample code)

Follow the steps below to to show or hide the controller pointer.
  1. Add the following code to get the controller instances.
    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];
        }
        if (_type == WaveVR_Controller.EDeviceType.NonDominant)
        {
            this.nonDominantController = (GameObject)args [1];
        }
    }
    
    void OnDisable()
    {
        WaveVR_Utils.Event.Remove (WaveVR_Utils.Event.CONTROLLER_MODEL_LOADED, OnControllerLoaded);
    }
  2. Assuming there are 2 functions, ShowPointer and HidePointer, use the following code.
    public void ShowPointer()
    {
        WaveVR_ControllerPointer _cp = null;
        if (this.dominantController != null)
        {
            _cp = this.dominantController.GetComponentInChildren<WaveVR_ControllerPointer> ();
            if (_cp != null)
            {
                _cp.ShowPointer = true;
            }
        }
        if (this.nonDominantController != null)
        {
            _cp = this.nonDominantController.GetComponentInChildren<WaveVR_ControllerPointer> ();
            if (_cp != null)
            {
                _cp.ShowPointer = true;
            }
        }
    }
    
    public void HidePointer()
    {
        WaveVR_ControllerPointer _cp = null;
        if (this.dominantController != null)
        {
            _cp = this.dominantController.GetComponentInChildren<WaveVR_ControllerPointer> ();
            if (_cp != null)
            {
                _cp.ShowPointer = false;
            }
        }
        if (this.nonDominantController != null)
        {
            _cp = this.nonDominantController.GetComponentInChildren<WaveVR_ControllerPointer> ();
            if (_cp != null)
            {
                _cp.ShowPointer = false;
            }
        }
    }
Submit
Thank You!