Local Variables

Hi. I have a little dumb question about local variables in blueprint functions.
When we create a function for a graph, we can add to that function local variables, ok… But these local variables cannot be the same name of a local variable for another function. So, if these variables are local, existing only inside that function, why on earth can’t them be the same name if for each particular function the variables outside it doesn’t exist?!?

I.E:
I have a function called SetValid and another function called GetValid.
Inside of each function, I create a bool variable called ‘IsValid’. But I can’t use the same variable name, even them being local. Just… Why? =[
I come from C# so I don’t know if this is related to C++, but I can’t see why locals can’t be duplicated variable names in a Blueprint graph.

Could be wrong but i guess the “local” is for the Blueprint and not for the function.
A real local variable for a function made in blueprints isn’t possible or? :X
Just some thoughts.

EDIT: Muha! A second faster xD

No, in C++ you can have local variables of same name. It probabaly because how blueprint is stored in uassets, which cant have same variable with same name in same blueprint. I think its something that Epic could correct later on

No, local varable is varable that exist inside the function scope for handleing things inside funtion and then its trashed after funtion is done. I think you mistaken it with private varables ; p

No, i meant the local one. I can’t remember that it is possible to create a local variable for each function in a blueprint all named the same.
In c++ you can. Maybe my english is making it harder to understand :smiley:

This has been fixed by Epic in latest 4.4.x release.
Thanks Epic :slight_smile: