So when I created another thread, I didn’t explain what I was doing so ill explain.
using UnityEngine;
public class UpgradeManager : MonoBehaviour {
public Click click;
public UnityEngine.UI.Text itemInfo;
public float cost;
public int count = 0;
public int clickPower;
public string itemName;
private float _newCost;
void Update() {
itemInfo.text = itemName + "\nCost: " + cost + "\nPower: +" + clickPower;
}
public void PurchasedUpgrade() {
if (click.cookie >= cost) {
click.cookie -= cost;
count += 1;
click.cookieperclick += clickPower;
cost = Mathf.Round(cost * 1.15f);
_newCost = Mathf.Pow(cost, _newCost = cost);
}
}
}
What I’m trying to do is create upgrades for a game I was making. But when I tried to make my code click.cookie -= cost; it was wrong, so I changed public float cost to public int cost, click.cookie -= cost; was right but Mathf.Round(cost * 1.15f); became wrong. So I need help I have no idea what to do in this situation.