Making an actor out of a bit of c++ physx code

I have a small bit of code that just makes a chain of capsules in c++ using physx.

I was wondering the steps to take to make an actor out of this code and give the option ofr the user to add or remove segments from the chain.

The idea is to have the user be able to spawn a chain that can be set to the deisred length in the UE…