Most of the time, the default functionality of the pawn is not enough for your application and you need to create your own pawn. Depending on your use-case, there are a few approaches:
- If you want to extend the default pawn, you can just subclass it and add your functionality on top. This won't allow you to modify the structure.
- If you need to modify the structure, you should base your pawn on the `BP_RWTHVRPawn_Base`. Then, compose your pawn by adding the components that you would like to have, or just copy the default pawn and delete what you don't want, both approaches should work.
- If you need C++ functionality, you should base your C++ class on the `ARWTHVRPawn`, and then create a Blueprint Pawn that is based on your custom C++ pawn. _Make sure you set the LiveLink and IMCs yourself then_!
**How to add functionality?**
There are many ways to add more functionality and logic to your pawn. Once you have decided which class to choose, you can either add your logic to your pawn class directly (in C++ or BP), or use _composition_.
With _composition_, you encapsulate your logic in your own Actor- or SceneComponent, and simply add the component to the pawn. This is generally preferred (if possible), as it creates a cleaner hierarchy and higher modularity.
**How to handle custom input?**
When using _composition_, to receive input in your custom component and bind your own InputActions, you can implement the `IInputExtensionInterface` and override `IInputExtensionInterface::SetupPlayerInput` to set up your own input. An example can be found in e.g. the `UDirectInteractionComponent` class.
Then, you need to bind your InputAction to a button by creating your own InputMappingContext. After creating it, you need to add it to your pawn's `InputMappingContexts` property.
All movement components are C++ derived blueprint components, which can be added to the `ARWTHVRPawn`. The blueprints itself can be found in `Components/Movement`. In the movement folder are two InputMappingContexts(IMCs) for either the left or right hand (which can be switched by (un-)ticking ``Move with Right Hand``). If you want to change the button mappings, you can adjust the respective IMC (best make a copy of them into your project first).
## Collision Handling Movement
This component is added to the pawn by default. It adds a configurable movement to your pawn implementation. It can be configured via the `NavigationMode`, which behaves as follows:
This component is added to the pawn by default. It adds a configurable movement to your pawn implementation.