WaveVR_ControllerInstanceManager (new in SDK 3.0)



Please refer to UnrealAPIUsageLevel for API compatibility.

WaveVR_ControllerInstanceManager is a new feature of the WaveVR SDK 3.0. It is a singleton component and is attached to an unable to destroy gameobject, and it holds controllers registered by the controller loader or the customized controller calling registerControllerInstance() API. The controller’s instance will be removed after calling the removeControllerInstance() API.

This manages the visual ability of a beam, controller pointer of a connected controller, and decides if this controller is able to send a button event to interact with other objects.

The priority of taking the right of control is as followings:

  1. Only 1 connected controller.
  2. Will use the dominant controller if there are 2 or more controllers.
  3. A controller will change its control right by pressing the Trigger key if this controller loses control right.

WaveVR_ControllerInstanceManager provides the following APIs to use:

  • WaveVR_ControllerInstanceManager Instance

This is a static member to get a singleton WaveVR_ControllerInstanceManager component.

  • int registerControllerInstance(WVR_DeviceType type, GameObject controller)

Register the controller instance and return the controller index.

  • void removeControllerInstance(int index)

Remove the controller instance if this index exists.

Sample Scene

  • ControllerInstanceMgr_Test is located in Assets/Samples/ControllerInstanceMgr_Test/scenes/


Prefabs ControllerInstanceManager is located in Assets/WaveVR/Resources/

Script WaveVR_ControllerInstanceManager.cs is located in Assets/WaveVR/Scripts/ControllerModel/

How to Use

WaveVR_ControllerLoader will automatically create a ControllerInstanceManager game object and register a controller instance when loading the controller model. If you want to apply the ControllerInstanceManager policy, please do the following:

  1. Use the WaveVR_ControllerInstanceManager Instance function to get a singleton component.
  2. Register a controller instance when connected.
  3. Remove a controller instance when disconnected (Note: the controller instance will be destroyed when a scene switches. Remember to remove the controller instance from ControllerInstanceManager).

How to register a controller

CtrInstanceMgr = WaveVR_ControllerInstanceManager.Instance;
if (CtrInstanceMgr != null)
    WVR_DeviceType _type = this.deviceType == WaveVR_Controller.EDeviceType.Dominant ?
        WVR_DeviceType.WVR_DeviceType_Controller_Right : WVR_DeviceType.WVR_DeviceType_Controller_Left;
    ControllerIdx = CtrInstanceMgr.registerControllerInstance(_type, controllerPrefab);
    Debug.Log("Type: " + _type + " controller index: " + ControllerIdx);

How to remove a controller

CtrInstanceMgr = WaveVR_ControllerInstanceManager.Instance;
if (CtrInstanceMgr != null)