I have been trying to look into this bug for a while and can’t seem to find a solution, so I am posting here to get some help. Now, I will say that I am not interested in a direct fix per se, but as I am new to coding still and Unity in general I am more interested in an answer that also explains why this happened so I can try to avoid it in the future, so here goes…
I am building an incremental game that, when clicked, will hire a Punk (granted they have enough requirements) when they hire the Punk it is supposed to increase the total amount of income by say 0.02 (What I have right now). The problem I noticed is that when he is hired, the “PunkH.increase” doesn’t get added, so I am unable to use it for the proper math… It isn’t an error, but a warning, either way it needs to be dealt with so I can create this game… warning says “BCW0028: WARNING: Implicit downcast from “Object” to “int”
Here is the relevant code:
var PunkH = new Hire (10, 0.02);
var Punk : int = 0;
class Hire {
var cost : int;
var increase : int;
function Hire (cost, increase) {
this.cost = cost;
this.increase = increase;
}
}
If there is anything else needed please let me know and I will try to provide as much information as I can. Thanks for the help!