I am attempting to split the render and collision geometry of an object. My current approach is this:
- Spawn a new actor
- Find the UStaticMeshComponent that I wish to duplicate and duplicate it
- Add, register, initialise and attach the newly duplicated component to the newly spawned actor
- Disable the renderer of the new component
- Remove the collision geometry from the original component
The issue I have lies in step 5 when I attempt to remove the collision geometry from the original component. As the component was duplicated, the reference to the BodySetup (in this case) was referenced rather than copied. This means that removing it from one instance removes it from the other which is not what I want to do.
My question is this: Is there a way to duplicate a component (and it’s parts) by copy instead of by reference?