Add a component to an actor copied from another component
I have 2 actors, a first actor and a second actor which is spawned from this first actor. The first actor will have a bunch of components added to it which drive the second actor, and as such these components often want to add components to the second actor in order to help them drive the actor (the second actor basically starts off as a blank slate, the components on the first actor will eventually build the second actor up into something more useful to them).
In some situations, it would be nice to be able to add a component to the second actor based on a component on the first actor. The example I have is that the first component may have a UShapeComponent on it for collision, and without knowing which shape component this is, it would be nice to be able to add the same shape component to the second actor so that the components on the first actor can listen for hit events on this second actor.
The question is, is there any way to add a copy of a component from one actor to another actor using a base class? Or am I required to create a specialized components to handle each type and copy the data over manually (in the example above, one for each of box, capsule and sphere)?
Follow this question
Once you sign in you will be able to subscribe for any updates here