#Random query?
1 messages · Page 1 of 1 (latest)
math.random, math.random_integer
both take 2 variables, a min and max. It returns a random value between those two
Thank you! do you know where I can find syntax examples?
{ "test": "math.random_integer(0,5)=5"}?
no: "test": "math.random(1, 4) == 3"
= is an operation that sets a variable, == is a comparator that checks if 2 values are equal
my bad. Thank you!
It will only add a slight delay though, conditions in animation controllers are ran each tick.
You'll need to define a variable prior to entering the state and check if that variable is equal to a value (you will need an escape state to make sure that it doesnt just transition to the check, then stay there until you reglog)
to define a variable, you can just do this
{
"check_rnd": "v.rand_int = math.random_integer(1,4); return query.is_jumping;"
}
Does that go in the states as its own state?
I'm not sure what you mean by that
Ohh wait nvm
where do I paste the variable in the animation controler?