How to a delete a component of another actor, but they're the same type of actor?

So i have an actor i want to spawn multiple of but each time I spawn a new one I want a component of an old one to be destroyed. I’ve tried making an array and calling a function and print debug shows the code is ran but the part isn’t deleted. Here’s an image before I made the array.

Right now you have the Port component of the brand new spawned actor being called to be destroyed rather than from an old actor. You would need to get a reference to the old actor you want to destroy it on.

ah I worded it wrong. I destroy components of both actors as I spawn them and the old ones have no problem but the new component should have the Port component destroyed but it cant be destroyed by another components blueprint

You can create your own function in the component-owning blueprint which will destroy a component (you can pass the component in as a parameter if you wish). That function would call “Destroy Component”, while you would call “MyDestroyComponentFunction” instead.

Note that the component does still need to be owned by the actor you call the DestroyComponent function within.

Here is with the function I created and set the new actor as the target but still nothing happens. All the print debug text shows that the code is running.

The issue with the implementation is that you are populating the Demo Parts array in the current actor, not the one you are spawning. Drag off your newly spawned actor and set the Demo Parts array on it instead.

Thank you for the help! that did the trick. here’s the Bp that works for anyone else having this issue.