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.
asked May 15 '19 at 03:33 AM in Blueprint Scripting
HP Laserjet 400
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.
answered May 15 '19 at 04:36 AM
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.
Follow this question
Once you sign in you will be able to subscribe for any updates here