In one of my MonoBehaviours, I am updating a FloatVariable every Update.
However, I am noticing that this is causing the Update for the function to be much slower than if I had just set a float.
With the line
myFloatVariable.Value = myFloat, the Update function takes 0.54ms to complete and has a bunch of GC allocations:

Setting only the float itself is significantly less time:

Anyone know why this might be the case?
Thanks!
In one of my MonoBehaviours, I am updating a
FloatVariableeveryUpdate.However, I am noticing that this is causing the
Updatefor the function to be much slower than if I had just set a float.With the line

myFloatVariable.Value = myFloat, the Update function takes 0.54ms to complete and has a bunch of GC allocations:Setting only the float itself is significantly less time:

Anyone know why this might be the case?
Thanks!