Hi, say you call a function which outputs some variable, which you want to modify the value of, or just read.
Why is it a good idea, or not, to promote it to a (local) variable?
Thanks.
Hey @AllGamesSuck!
So the first point is cleanliness and keeping your graph organized. Especially a variable you’d use over and over again in different spots - spaghetti code is to be avoided, readable code is more important than functional code, not only to a team but even when you’re a solo dev. 6 months down the road you need to be able to read it, too!
Another point would be that sometimes things need to be saved, this is primarily involving ref and copy GET nodes for Arrays.
Lastly, and most importantly, variables may need to be called upon from outside the blueprint. In order to do so, it needs a variable to be set in order to reference it.
Hope that helps!
1 Like
I’ll just add that function inputs are already local variables.
1 Like