Hi Guys
I’ve been learning basic coding and have found all the answers really helpful, Kudos. But I’m stumped on this one. I’ve got an onmousedown function set up so when you tap an object it destroys it and increases the score. I’m trying to make it so when the score hits five a URL opens.
Destroy and count work fine, but website won’t open at five. (or anything).
static var score = 0;
private static var numKills : int;
var killsDisplay : GUIText;
function OnMouseDown ()
{
Destroy(gameObject);
numKills++;
killsDisplay.text = ("Bitcoins Found: "+ numKills + "/5");
score = score+1;
guiText.text = ""+score;
if(numKills == "5") { Application.OpenURL("https://ww.google.com"); }
}
If I get rid of everything and just do onmousedown - openapplication and it works fine so I’m guessing it’s either my if statement or my counting.
If anyone could help me i would be super stoked.