Random function constantly picks new numbers... How to prevent this?
FlyboyTrevy_
Member, PRO Posts: 148
So I have an attribute that has a couple of random functions within the equation. The problem is, the game constantly picks a new random number as the game is in runtime. How would I set it so that when the equation starts it just picks one and goes with it.
Comments
Just take the random out of the behavior that's causing it to constantly fire?
Mathtap.com (Android) | Fridgemanager.com (Android) | Breakoutofspace.com (Android)
Change self.R to random(a,b)
Then use R where you are currently using the random function.
Without seeing your rule, it's hard to know what you mean exactly and why it might be a problem.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Well I thought of putting it into an attribute, but im spawning off 15-20 of the same actor, and I want them to each have different values in that formula.
Yes, the code I posted above will work fine for that.
Change self.R to random(a,b)
Then use R where you are currently using the random function.