C
C#3y ago
Oli

i have a variable in one method and want to use it in a different one

if i try make it public it breaks the whole code
7 Replies
Oli
OliOP3y ago
Oli
OliOP3y ago
originally i made checkP1/2 into other variables but i thought it probably wasnt the easiest way to get it working
Oli
OliOP3y ago
i also wanted to get rid of this block at the start
phaseshift
phaseshift3y ago
Either push the variable into the other method as an argument, or use class field/property
Oli
OliOP3y ago
how would i do that
phaseshift
phaseshift3y ago
You're already doing it with other data Like you pass team1 variable into penalty method
Oli
OliOP3y ago
ohh i see cheers
Want results from more Discord servers?
Add your server