How to auto switch controller when you only want to display one controller in scene

Introduction

In order to facilitate the display of only one controller in the situation when the developer wants
to maintain two active controllers in the scene. Here, we show you how to do this.

How to use

Add the following code to dynamically switch controllers:

  1. In Tick, the current controller connection status will be monitored and display only one controller.
../_images/isInputPoseValid.png ../_images/CreateControllerActor.png
  1. LoaderInstance will be destroyed and set to null when one of the controllers is disconnected.
../_images/BindControllerEventAndDestroy.png