I need to do variables instead of attributes

Do you know any code to add variables instead of attributes, because i need it to be changeable based on player state, so when the player state is running, when the character is running, i can change the gun accuracy.

Hi @Gavin_Durbin,

What do you mean variables instead of attributes? Do you mean that you want to have a variable that other parts of your script can access without being part of the same function? If so, you just need to declare them in your initialize function. Something as simple as this.randomVar = randomValue;

1 Like

Sorry, i just didn’t know the code to set a variable