Blueprints, how to set a BP Object variable to Null/None

In Blueprints, how do I set a BP Object variable to Null/None? I’m seeing some conflicting things online about this. But nothing I tried has worked. I don’t like the idea of doing a hacky work around solution where I save None/Null in a variable and then set it to that. That seems horrible

I tried this screenshotted below where I call set and just leave the connector empty but it doesn’t seem to work. I can use C++ but that seems silly for my current use case

yes,this is how you set it to empty in blueprint.now it no longer valid.

but I feel that you want to make it disappear. like unload it from memory.
if so unfortunately you can’t do that. you set it to empty it still sits in memory.

good news though, you can set it to actor type.use interface to interact.so even if it’s in memory it’s several KB.

What do you mean? I’m not understanding the solution you recommend. Can you show an example?

the screenshot should work.

1 Like

Yeah I just tried it in a blank project to test, and it worked just fine in my blank project. I’m testing it by checking “IsValid”. So I think my code has a bug somewhere else and not related to this Nulling of the variable.

But would you say this is the correct way to Null/None out a variable? or is this considered a hack?

Thank you

no,it’s not a hack.
the SET node means storing a value to it.and without connecting a value,it stores nothing.
I think that’s pretty logical.

1 Like