Download

Functions not setting objects to None

(also posted here : Functions not setting objects to None - would like to request a None variable type in BP to hook up to conditions - UE4 AnswerHub)
any help would be appreciated!

I have an issue with setting variables to None/Null etc…

I’ve now had this issue in a couple of places:

once in calling the standard Set variable on an object/actor. When I pass an object variable it gets set correctly. If I pass nothing to it, the variable doesnt get set to None, it just stays as the previous value.

and now with the Single Line Trace By Chanel : Out Hit -> Break Hit Result -> Hit Actor as soon as the Trace is successful the Hit Actor is set, but then when the Trace fails, it never sets the Actor to none, it always keeps its last successful Actor trace

Neither of these behaviors seems correct to me, and I assume this is me misunderstanding how variables are set?

I should be able to set a variable to None in some way ?

I thought I’d post here in case it is a bug - which it currently seems to me, sorry if I’m wrong

I have noticed this behavior as well, and I discussed it on IRC #unrealengine on freenode as well.

This seems to be by design, it is also why you get the boolean. It tells you if it hit something.

really…?
that is terrible… :S :S

so i can’t set a variable object to none ?
which means, all my graph nodes cant be filled with if object != none, but rather a lot of bool checks…?

i get this same behavior just setting a reference to a Volume - once set, i can’t set it to None. i dont want to be setting bools true or false when i already (should) have a reference to an Object existing or not.

Why did they choose this design ?
Can we request a change ? immediately ? lol

this might help you

https://answers.unrealengine.com/questions/41566/bug-blueprint-function-local-var-never-de-referenc.html

Oh, this is nice to hear.