Variable interaction

Hello everyone.
I think the answer to my question is rather simple, but it eludes me.
How would I make one variable on a gameobject scale with another variable?
I’m trying to make a skilltree and my skills are upgradable. But for each time the player buys the upgrade, the amount of skillpoints required should be bigger.
First click sets skill to level one.
Deducts 1 skillpoint from player remaining skillpoints.
Now if the player clicks it again i should deduct 5 points and set the skill to level 2. Next time 10 points. Etc…
Thank you in advance :smiling_face:

Define a function:

int getSkillPointsRequiredForLevel(int level)
	// your implementation here

and call this function when you need to know how many skill points to deduct.

I don’t understand your answer, sorry. Which tells me that I’m over my head on this one.
I’ll go back to the books.

int getSkillPointsRequiredForLevel(int level)
    int needSkillPoints = level * 5;

        return neededSkillPoints;

But thank you for the answer and I’ll tag it as accepted :slight_smile: