- Home /
How can i randomly increase/decrease a value over time?
Basically I want to make something like a stock market in my game.
Comment
Best Answer
Answer by RLin · Apr 25, 2018 at 11:31 PM
Some pseudo code:
nextPoint = previousPoint + Random.Range(-maxChange,maxChange);
previousPoint is your previous point in the graph. nextPoint is the next point. maxChange is the maximum amount by which the points can differ. What this does is it randomly adds or subtracts from the previous point within a given range to generate the next point. You can keep creating new points as desired.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
how to increase or decrease ammo ?? but depending of ammo in inventory 1 Answer
C# Input.GetAxis Increment/Decrement Value 0 Answers
Intensifying rate over time... 1 Answer