Download

Can't remove a component

Hi,

I am facing a problem I don’t understant. I can’t remove a mesh which reference is stocked in a array.

I am firstly adding it like this :

1

Then when I try to delete it, i can see that element are adding and not removing :

2

3

I am using exactly this same system somewhere else, and it is perfectly working, I don’t understand why here is doesn’t.

Any idea guys ? Thank you !

Are both screenshots from the same blueprint or are you passing the array to another actor for removal? Or perhaps those SMCs are assigned another owner than the actor trying to Destroy them?

I am referring to this:

1 Like

Thank for your answer. This is indeed in the same blueprint.
So the component here is owned by my player. And I want my player to destroy this component.
“Unless the owning actor is calling the function” so this is what i’m doing in this case, no ?

Or maybe the owner is the BP I am adding this component to ?

Yeah, that should be fine, according to this:

image

i can see that element are adding and not removing:

So how are you testing this?

This removes it correctly. You can print their name because they’re still around at that time but it does destroy them.

1 Like

Ok I understood way better thank to your help Everyone. I was actually having a lot of functions in the wrong place ( function related to my wall building system) inside my thirdPerson Blueprint. I created specialised function in my spline blueprint and call it from the third person now, it is working way better. Thank you a lot !

1 Like

Yes exactly, in fact my spline components were owned by the bluesprint I added just before so I guess this was my mistake

1 Like

I understand the concept better now

1 Like