CustomControllers Sample Scene
Updated: May 8, 2024
The Unity CustomControllers sample scene demonstrates how to implement custom controller models as a user’s hands.
In this scene, the user has a pair of custom controllers that can be moved around. There are no hands, but the buttons and triggers do react when pressed.
The goal of this topic is to help you use the prefabs and components that make custom controllers work. You can also use this sample scene as a starting point for your own application.
This section briefly describes the prefabs that make the core functionality of this scene work.
- LeftControllerPf and RightControllerPf prefabs: Prefabs that contain the necessary component for custom controllers.
LeftControllerPf and RightControllerPf Prefabs These prefabs are used to implement custom controllers. Each has only one component, Touch Controller
, which implements the custom controller models, specifies their controller assignment, and handles animation of the buttons. Its properties are as follows:
- Controller: Physical controller that the custom VR controller is attached to.
- Animator: Model and animation information for the custom controller.
Adding custom controllers requires you to add the LeftControllerPf
and RightControllerPf
prefabs. They come equipped with models and animators you can use and modify in your own applications.
Note the importance of placement of the prefabs in the Hierarchy. If the LeftControllerPf
and RightControllerPf
prefabs are not child objects of LeftHandAnchor
and RightHandAnchor
, the controllers will not appear in front of you as though they were attached to your hands.