replace variable with random number
so lets say I have
int a = something
what do I put instead of something
to make a
change value each time its called
for example:
14 Replies
I can interact only with
a
. I cant write any other external methodRandom.Shared.Next()
but you can't do exactly what you're asking
a variable can't magically change when you retrieve the value, you need to write code that changes itsad
you want a method, not a variable
methods do things when you call them
ik
I need this for a unity game
are there any unity components that can do this
f.e. on start change specific variable
nothing will do exactly what you want
because variables can't change by themselves
you need more code that changes them when you want them to change
thats what im talking about
is there some unity component
i'm sure unity has a random class
check their docs
yes but
once assigned it wont change
correct
mhm ok
you have to change it if you want it to change
thx for help
Can you not use a method or property instead of
a
?