(solved thank you !)

so i am working on a clicker incremental game, I have 2 scripts set up, and its working to add on clicks, and even the upgrades work… but the text for some reason i cant get to appear and count how many you have.

here are my scripts,

using UnityEngine;
using System.Collections;

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.virus >= cost) {
            click.virus -= cost;
            count += 1;
            click.virusPerClick += clickPower;
            cost = Mathf.Round(cost * 1.15f);
            _newCost = Mathf.Pow (cost, _newCost = cost);
        }
    }

}
using UnityEngine;
using System.Collections;

public class Click : MonoBehaviour {

    public UnityEngine.UI.Text goldDisplay;
    public float virus  = 0.00f;
    public int virusPerClick = 1;


    void update(){
        goldDisplay.text = "Gold: " + virus;

    }

    public void Clicked(){
        virus += virusPerClick;

    }

}

i then drug the text object into the clicker object, but for some reason it still doesnt count. if anyone could help me out that would be great, thanks! or if you have a better suggestion about how to get this done that would be great too, just looking for any kind of thoughts as to why im not getting the text to show and update thanks!

i was going off a gold miner tutorial, started switchign it over to viruses, but it didnt work before i started changing it over either

update should be Update

ah, doh! i knew that… thanks for the responce. are you lds? i am as well :stuck_out_tongue:

i fixed that, and the text still seems to not be updating, it counts when i click and upgrades still. ill look at it some more, is there anything special i need to do with the text object i make to put in the slot for the count? or can i just make a ui object text, and then drag it into that slot ?

nevermind, i worked it out, thanks! i have to put the game object with the clicking script into the slot, not the script. :slight_smile:

hmm, any idea the best way to make a check? im trying to check if you have 50 tech points, then it will subtract 50 tech points, and let you buy a virus. here is my code, trying to work out what im missing again. thanks!

using UnityEngine;
using System.Collections;

public class VirusClick : TPB  {

    public int cost = 50;
    public VirusClick click;
  //  public UnityEditor.UnityEngine.UI.text vpc;
    public UnityEngine.UI.Text VirusCount;
    public float virus  = 0.00f;
    public int virusPerClick = 1;

    //public int techPoints;

    void update(){
        VirusCount.text = "Virus Count: " + virus;
    //    vpc.text = "VPC: " + virusPerClick;

    }

    public void Clicked(){
        if(techPoints >= cost) {
            techPoints -= cost;
            virus += 1;

        }
    }

}