- Home /
BCE0022: Cannot convert 'String' to 'int'.
HI, I'm new with unity. I'm trying to practice but i'm getting this error BCE0022: Cannot convert 'String' to 'int' with this: can someone help me please?
var score: int = "500";
var personnage: String = "Jean";
var estArme : boolean = false;
print("Le score de " + personnage + " vaut " + score + " et il est arme" + estArme);
Comment
Answer by sparkzbarca · Apr 03, 2015 at 01:14 AM
int = "500"
should be
int = 500
placing something in parathensis means its a string
typing var score : int means score is an int
cannot convert string to int.