code only activating for a split moment
I think whats happening is since I put the 2 methods in an if statement, now they only run for a split second instead of updating every frame with void update. How do I make the methods update every frame so it works properly?

7 Replies
Seeing how it's Unity,
Update()
runs every frame
So, most likely, something else is wrong
A debugger would probably helphuh
the code works fine if I remove the if statements and just give it one of the 2 methods to run
Unity's Random.Range returns a float with its upper bound being inclusive. Your conditions will almost never be true
You should read the documentation of the methods you use
float, float
is inclusive
int, int
is exclusive
So, yes, .Range(1, 3)
will return either 1 or 2
That part is fineReally? There's an extra overload?
Maybe I should read the docs of the stuff I talk about
ok yall took wayyyy too long and trying like 7 different things before realizing it was just cause im setting cooldown = 0.0f at the start, but the if is only active if its 5.0f or higher ðŸ˜
im dumb
well atleast its workin now