# Custom C++ Control Rig Class

Custom control rig classes can be created by extending the UControlRig class in C++:

```cpp
#pragma once

#include "CoreMinimal.h"
#include "ControlRig.h"
#include "MyCustomRig.generated.h"

UCLASS(Blueprintable)
class MYGAME_API UMyCustomRig : public UControlRig
{
	GENERATED_BODY()

public:
	virtual void Initialize(bool bInitRigUnits = true) override;
	virtual bool Execute(const FName& InEventName) override;
};

```

You will also need to add "ControlRig" and "RigVM" to public dependency modules in build.cs.

After you've compiled the class, you **must** create it via right click menu in content browser:

<figure><img src="https://3558733374-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPratlX5Y75g7mK9upu8G%2Fuploads%2F0i2OkMyPiem7orBsS5wT%2FUntitled.png?alt=media&#x26;token=ff438f00-dd8c-4439-a45d-35df2a10cda8" alt=""><figcaption></figcaption></figure>

*Why would I create a C++ control rig class?*

For many of the same reasons you might want to inherit from any class. If you have 5 characters with similar but unique rigs in your project, each would require their own control rig class, since they are not using identical rig hierarchies. If you create a custom C++ control rig class, you'll still need 5 control rigs for each unique rig, but now they can have common members which keeps things consistent between each class and makes it unnecessary to update or add members in each individual class.
