- Home /
Cookie Clicker -esque rate equation?
I've come up with a wizard entrepreneur game that revolves around building up a tower, enchantments, treasury, and spellcasting power overall. However, the main way to make money will be through making and selling enchantments, and I want to be able to allow the enchanting speed to change throughout the game. However, the equation I have now does not seem to do the trick:
void Update()
{
time = Time.time;
enchantments = time*speed;
Enchants.text = "Enchantments Completed: " + enchantments.ToString();
}
I understand that the equation itself does not work, but I've picked up Unity as a casual hobby to experiment with scenery. This is the first project I've definitely had eyes for, so any help would be appreciated.
Answer by H1ddeNGames · Dec 22, 2018 at 10:41 AM
Why not use an Animation curve
This would let you set the equation graphically rather than programmatically.
Set this in your game manager or similar script:
public AnimationCurve enchantingSpeed;
Then in the inspector, play with the curve until you feel that it's right for your game. The link to the API should help once you're done with that.
Your answer
Follow this Question
Related Questions
Double Key Press FPS Animator Controller 0 Answers
My Enemy takes double damage when i throw a knife at the enemy 0 Answers
Shader worked in Unity 4.5, now Unity 5 kills it. 1 Answer
Rotate camera to default position when player collides 0 Answers
Unity3d android apk file becomes huge without any scene 0 Answers