Help

net

#1

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class scripts : MonoBehaviour {
public UnityEngine.UI.Text gpc;
public UnityEngine.UI.Text foodDisplay;
public float food = 0.00f;
public int foodPerClick = 1;

void Update() {
    gpc.text = "GPC: " + foodPerClick;
    foodDisplay.text = "food: " + food;

   
}

public void Clicked() {
    food += foodPerClick;

}

}
the line gpc.text = "GPC: " + foodPerClick; does not work. Can someone help?


#2

What code format is this? and can you have link to the lesson number.

I have two questions

  1. Is "GPC: " defined
  2. is it supposed to be inside quotation marks

#4

The OP code looks like either .NET or C#. Neither of these are taught here.


#5

what do you mean with defined?
and it is C#


#6

Is "GPC: " a variable and if it is, is it defined, if it is not, what is GPC representing


#7

https://www.google.ca/search?q=gpc+C%23

General Polygon Clipper

Again, related to C#.


#8

ohh I am sorry… it is just that i could not find any help…


#9

No harm done, and no need to apologize. There may well be somebody who is informed of C# who could help. Its not being on the curriculum kind of stacks things against your getting any help here, though it is not outside the realm of possibility.


#10

hmm, it might be a unity thing as well, because i followed a youtube guide, and only changed a few words