Object value is changed before setting it in Unreal Engine 4.27.2

Hay!

I’m verifying the value of a Text object in Unreal then setting the value after the branch node. However the value is changed before. I managed to isolate the issue and reproduce the bug in that small blueprint (The execution before is just the BeginPlay event attaching the debug interface then leading up here):

The results in the Direction Trace output (Small function that displays the value requested) is always “Up” and the Actual Content shows “New Value”.

However, Direction will be “Down” and Actual Content will show the correct original value (“Hazard 3”) if I remove the last node that sets “Short Difficulty Name”.

Furthermore, if I compare the original value with a random integer like so:


Direction will show “Down” while “Actual Content” still shows “New Value”

I really don’t get it, tried copying the value of the Text instead in case it was a pointer issue, reading online if the Branch node or pure functions had a delay, comparing Text instead of String

I ended up fixing the issue by adding a 0.0001s delay after reading variable and before writing anything, then the values were correct.