Not really a clear question, is it in the update function. if so then it is probably why… It’s best to be detailed with your questions and maybe show more than just 2 lines. How about this, go to youtube and give bergzergarcade a quick look. His vids might help you figure something out.
Well, the Answer i am looking for was what to do with this line “if (GetComponent().curMagic >= GetComponent().curMagic){”
Because, i need to do so that when curMagic increases by one, maxMana is also increased by 15.
It is not in the update function , it is in “public void AddjustCurrentMana(int adj) {”
About burgzergarcade, i have seen alot of the videos and they are really helpful, mostly it is him i learned the basic i can do from.
Yeah, figured. Okay, and I’m assuming that the AddjustCurrentMana is called FROM Update. And that is why it constantly increases. But you’re going to need to make a condition that calls the increase of the stats once. Off the top of my head, you could do something like if the current exp reaches the max exp to level up then up the stats and put the current exp back to zero.
Well, it is being CALLED from Update. When you put the other method in Update its still being called every frame. But, yeah you also don’t have the curExp going back to zero. Uhm, I whipped up a real quick test but I personally don’t want to implement it into what you’re doing. haha Sorry but I’m slacking on my own stuff as it is. haha But here ya go.
public int maxExp = 3,
curExp = 0,
stat = 0;
// Update is called once per frame
void Update ()
{
if (curExp >= maxExp)
{
stat += 3;
curExp = 0;
}
if (Input.GetKeyDown(KeyCode.Z))
{
curExp++;
}
}
This Script dident really work
I was looking for something to just simplify it to something that looked like this but worked!
"
(GetComponent().curMagic += 1){
maxMana += 15;