How Do you increment a local variable

How do you increment a local variable? I managed to increment a normal variable but when I tried doing the same procedure for a local variable it just keeps printing 1. It doesn’t go up.

In c++ you can declare it as static, but in BP you can’t, so any local variable will be reconstructed with default value when function called.

In case you want to use function to increment something - you need to use external variable.

You can increment it within the function that it is local to. However, In order for that value to carry over beyond the first run of the function, you you will have to feed the end value to a global variable. One way to do this is to have a Float or Int variable that holds the value. Feed that variable as an input to the function you are trying to use increment as needed then pass the resulting value back to the global variable. Hope that helps.

Hey man, thanks for the explanation. I knew I had no choice so I decided to use the external variables instead.

thank you!