Gas: Calculate Magnitude not working

In my case, this error occurred because I applied the effect before initializing the attributes. Check initialization and effect applying order.